def check_ca_status(self): """GET status from dogtag to see if it is running""" try: status = dogtag.ca_status(api.env.host) logger.debug('The CA status is: %s' % status) except Exception as e: self.failure('CA is not running: %s' % e)
def __wait_until_running(self): # We must not wait for the httpd proxy if httpd is not set up yet. # Unfortunately, knownservices.httpd.is_installed() can return # false positives, so check for existence of our configuration file. # TODO: Use a cleaner solution use_proxy = True if not (os.path.exists('/etc/httpd/conf.d/ipa.conf') and os.path.exists('/etc/httpd/conf.d/ipa-pki-proxy.conf')): root_logger.debug( 'The httpd proxy is not installed, wait on local port') use_proxy = False root_logger.debug('Waiting until the CA is running') timeout = api.env.startup_timeout op_timeout = time.time() + timeout while time.time() < op_timeout: try: status = dogtag.ca_status(use_proxy=use_proxy) except Exception: status = 'check interrupted' root_logger.debug('The CA status is: %s' % status) if status == 'running': break root_logger.debug('Waiting for CA to start...') time.sleep(1) else: raise RuntimeError('CA did not start in %ss' % timeout)
def check_ca_status(self): """GET status from dogtag to see if it is running""" if not self.ca.is_configured(): logger.debug("No CA configured, skipping trust check") return try: status = dogtag.ca_status(api.env.host) logger.debug('The CA status is: %s' % status) except Exception as e: self.failure('CA is not running: %s' % e)
def is_running(self, instance_name="", wait=True): if instance_name: return super(RedHatCAService, self).is_running(instance_name) try: status = dogtag.ca_status() if status == 'running': return True elif status == 'starting' and wait: # Exception is raised if status is 'starting' even after wait self.wait_until_running() return True except Exception as e: root_logger.debug('Failed to check CA status: {err}'.format(err=e)) return False
def is_running(self, instance_name="", wait=True): if instance_name: return super().is_running(instance_name) try: status = dogtag.ca_status() if status == "running": return True elif status == "starting" and wait: # Exception is raised if status is 'starting' even after wait self.wait_until_running() return True except Exception as e: logger.debug("Failed to check CA status: %s", e) return False
def wait_until_running(self): root_logger.debug('Waiting until the CA is running') timeout = float(api.env.startup_timeout) op_timeout = time.time() + timeout while time.time() < op_timeout: try: status = dogtag.ca_status() except Exception as e: status = 'check interrupted due to error: %s' % e root_logger.debug('The CA status is: %s' % status) if status == 'running': break root_logger.debug('Waiting for CA to start...') time.sleep(1) else: raise RuntimeError('CA did not start in %ss' % timeout)
def is_running(self, instance_name="", wait=True): if instance_name: return super(RedHatCAService, self).is_running(instance_name) try: status = dogtag.ca_status() if status == 'running': return True elif status == 'starting' and wait: # Exception is raised if status is 'starting' even after wait self.wait_until_running() return True except Exception as e: root_logger.debug( 'Failed to check CA status: {err}'.format(err=e) ) return False
def wait_until_running(self): root_logger.debug('Waiting until the CA is running') timeout = float(api.env.startup_timeout) op_timeout = time.time() + timeout while time.time() < op_timeout: try: # check status of CA instance on this host, not remote ca_host status = dogtag.ca_status(api.env.host) except Exception as e: status = 'check interrupted due to error: %s' % e root_logger.debug('The CA status is: %s' % status) if status == 'running': break root_logger.debug('Waiting for CA to start...') time.sleep(1) else: raise RuntimeError('CA did not start in %ss' % timeout)
def wait_until_running(self): logger.debug("Waiting until the CA is running") timeout = float(self.api.env.startup_timeout) op_timeout = time.time() + timeout while time.time() < op_timeout: try: # check status of CA instance on this host, not remote ca_host status = dogtag.ca_status(self.api.env.host) except Exception as e: status = "check interrupted due to error: %s" % e logger.debug("The CA status is: %s", status) if status == "running": break logger.debug("Waiting for CA to start...") time.sleep(1) else: raise RuntimeError("CA did not start in %ss" % timeout)
def wait_until_running(self): logger.debug('Waiting until the CA is running') timeout = float(self.api.env.startup_timeout) op_timeout = time.time() + timeout while time.time() < op_timeout: try: # check status of CA instance on this host, not remote ca_host status = dogtag.ca_status(self.api.env.host) except Exception as e: status = 'check interrupted due to error: %s' % e logger.debug('The CA status is: %s', status) if status == 'running': break logger.debug('Waiting for CA to start...') time.sleep(1) else: raise RuntimeError('CA did not start in %ss' % timeout)