If osd_admin_socket call succeeds, return. Otherwise wait five seconds and try again.
(self, service_type,
service_id, args=['version'], timeout=75, stdout=None)
| 2066 | '0') |
| 2067 | |
| 2068 | def wait_run_admin_socket(self, service_type, |
| 2069 | service_id, args=['version'], timeout=75, stdout=None): |
| 2070 | """ |
| 2071 | If osd_admin_socket call succeeds, return. Otherwise wait |
| 2072 | five seconds and try again. |
| 2073 | """ |
| 2074 | if stdout is None: |
| 2075 | stdout = StringIO() |
| 2076 | tries = 0 |
| 2077 | while True: |
| 2078 | proc = self.admin_socket(service_type, service_id, |
| 2079 | args, check_status=False, stdout=stdout) |
| 2080 | if proc.exitstatus == 0: |
| 2081 | return proc |
| 2082 | else: |
| 2083 | tries += 1 |
| 2084 | if (tries * 5) > timeout: |
| 2085 | raise Exception('timed out waiting for admin_socket ' |
| 2086 | 'to appear after {type}.{id} restart'. |
| 2087 | format(type=service_type, |
| 2088 | id=service_id)) |
| 2089 | self.log("waiting on admin_socket for {type}-{id}, " |
| 2090 | "{command}".format(type=service_type, |
| 2091 | id=service_id, |
| 2092 | command=args)) |
| 2093 | time.sleep(5) |
| 2094 | |
| 2095 | def get_pool_dump(self, pool): |
| 2096 | """ |
no test coverage detected