(self, s, partial=False)
| 570 | self.nameid: Optional[int] = None |
| 571 | |
| 572 | def valid(self, s, partial=False): |
| 573 | if s == '*': |
| 574 | self.val = s |
| 575 | return |
| 576 | if s.find('.') != -1: |
| 577 | t, i = s.split('.', 1) |
| 578 | if t != 'osd': |
| 579 | raise ArgumentValid('unknown type ' + t) |
| 580 | else: |
| 581 | t = 'osd' |
| 582 | i = s |
| 583 | try: |
| 584 | v = int(i) |
| 585 | except ValueError: |
| 586 | raise ArgumentFormat(f'osd id {i} not integer') |
| 587 | if v < 0: |
| 588 | raise ArgumentFormat(f'osd id {v} is less than 0') |
| 589 | self.nametype = t |
| 590 | self.nameid = v |
| 591 | self.val = v |
| 592 | |
| 593 | def __str__(self): |
| 594 | return '<osdname (id|osd.id)>' |
nothing calls this directly
no test coverage detected