(self, s, partial=False)
| 693 | 'Fragment' ??? XXX |
| 694 | """ |
| 695 | def valid(self, s, partial=False): |
| 696 | if s.find('/') == -1: |
| 697 | raise ArgumentFormat('{0}: no /'.format(s)) |
| 698 | val, bits = s.split('/') |
| 699 | # XXX is this right? |
| 700 | if not val.startswith('0x'): |
| 701 | raise ArgumentFormat("{0} not a hex integer".format(val)) |
| 702 | try: |
| 703 | int(val) |
| 704 | except ValueError: |
| 705 | raise ArgumentFormat('can\'t convert {0} to integer'.format(val)) |
| 706 | try: |
| 707 | int(bits) |
| 708 | except ValueError: |
| 709 | raise ArgumentFormat('can\'t convert {0} to integer'.format(bits)) |
| 710 | self.val = s |
| 711 | |
| 712 | def __str__(self): |
| 713 | return "<CephFS fragment ID (0xvvv/bbb)>" |
nothing calls this directly
no test coverage detected