(self, s, partial=False)
| 528 | self.nameid: Optional[str] = None |
| 529 | |
| 530 | def valid(self, s, partial=False): |
| 531 | if s == '*': |
| 532 | self.val = s |
| 533 | return |
| 534 | elif s == "mgr": |
| 535 | self.nametype = "mgr" |
| 536 | self.val = s |
| 537 | return |
| 538 | elif s == "mon": |
| 539 | self.nametype = "mon" |
| 540 | self.val = s |
| 541 | return |
| 542 | if s.find('.') == -1: |
| 543 | raise ArgumentFormat('CephName: no . in {0}'.format(s)) |
| 544 | else: |
| 545 | t, i = s.split('.', 1) |
| 546 | if t not in ('osd', 'mon', 'client', 'mds', 'mgr'): |
| 547 | raise ArgumentValid('unknown type ' + t) |
| 548 | if t == 'osd': |
| 549 | if i != '*': |
| 550 | try: |
| 551 | int(i) |
| 552 | except ValueError: |
| 553 | raise ArgumentFormat(f'osd id {i} not integer') |
| 554 | self.nametype = t |
| 555 | self.val = s |
| 556 | self.nameid = i |
| 557 | |
| 558 | def __str__(self): |
| 559 | return '<name (type.id)>' |
no test coverage detected