def _pat_checker(self, fn, patterns): (root_fn, fn_ext) = os.path.splitext(fn) if utils.has_any(fn_ext.lower(), *BAD_EXTENSIONS): return False for pat in patterns: if pat.match(fn): return True return False
def _pat_checker(self, fn, patterns): (_root_fn, fn_ext) = os.path.splitext(fn) if utils.has_any(fn_ext.lower(), *BAD_EXTENSIONS): return False for pat in patterns: if pat.search(fn): return True return False
def status_app(self, program): status_cmd = self.get_command("status", program) try: output = sh.execute(status_cmd, shell=True)[0] except excp.ProcessExecutionError: return False if utils.has_any(output, "is not running"): return False return True
def statii(self): (sysout, stderr) = self._run_action('status', check_exit_code=False) combined = (sysout + stderr).lower() st = comp.STATUS_UNKNOWN if combined.find("is running") != -1: st = comp.STATUS_STARTED elif utils.has_any(combined, 'stopped', 'unrecognized', 'not running'): st = comp.STATUS_STOPPED return [ comp.ProgramStatus(status=st, details=(sysout + stderr).strip()), ]
def statii(self): # This has got to be the worst status output. # # I have ever seen (its like a weird mix json+crap) (sysout, stderr) = self._run_action("status", check_exit_code=False) st = comp.STATUS_UNKNOWN combined = (sysout + stderr).lower() if utils.has_any(combined, "nodedown", "unable to connect to node", "unrecognized"): st = comp.STATUS_STOPPED elif combined.find("running_applications") != -1: st = comp.STATUS_STARTED return [comp.ProgramStatus(status=st, details={"STDOUT": sysout, "STDERR": stderr})]
def status(self): status_cmd = self.distro.get_command('apache', 'status') (sysout, stderr) = sh.execute(*status_cmd, run_as_root=True, check_exit_code=False) combined = (sysout + stderr).lower() st = comp.STATUS_UNKNOWN if combined.find("is running") != -1: st = comp.STATUS_STARTED elif utils.has_any(combined, 'stopped', 'unrecognized', 'not running'): st = comp.STATUS_STOPPED return [ comp.ProgramStatus(status=st, details=(sysout + stderr).strip()), ]
def status(self): status_cmd = self._get_run_actions('status', excp.StatusException) (sysout, stderr) = sh.execute(*status_cmd, run_as_root=True, check_exit_code=False) combined = (sysout + stderr).lower() st = comp.STATUS_UNKNOWN if combined.find("running") != -1: st = comp.STATUS_STARTED elif utils.has_any(combined, 'stop', 'unrecognized'): st = comp.STATUS_STOPPED return [ comp.ProgramStatus(name=self.get_option("type"), status=st, details=(sysout + stderr).strip()), ]
def statii(self): (sysout, stderr) = self._run_action('status', check_exit_code=False) combined = (sysout + stderr).lower() st = bruntime.STATUS_UNKNOWN if combined.find("is running") != -1: st = bruntime.STATUS_STARTED elif utils.has_any(combined, 'stopped', 'unrecognized', 'not running'): st = bruntime.STATUS_STOPPED return [ bruntime.ProgramStatus(name='apache', status=st, details={ 'STDOUT': sysout, 'STDERR': stderr, }), ]
def statii(self): (sysout, stderr) = self._run_action('status', False) combined = (sysout + stderr).lower() st = bruntime.STATUS_UNKNOWN if combined.find("running") != -1: st = bruntime.STATUS_STARTED elif utils.has_any(combined, 'stop', 'unrecognized'): st = bruntime.STATUS_STOPPED return [ bruntime.ProgramStatus(name=self.applications[0].name, status=st, details={ 'STDOUT': sysout, 'STDERR': stderr, }), ]
def statii(self): (sysout, stderr) = self._run_action('status', False) combined = (sysout + stderr).lower() st = comp.STATUS_UNKNOWN if combined.find("running") != -1: st = comp.STATUS_STARTED elif utils.has_any(combined, 'stop', 'unrecognized'): st = comp.STATUS_STOPPED return [ comp.ProgramStatus(name=self.applications[0].name, status=st, details={ 'STDOUT': sysout, 'STDERR': stderr, }), ]
def status(self): # This has got to be the worst status output. # # I have ever seen (its like a weird mix json+crap) status_cmd = self.distro.get_command('rabbit-mq', 'status') (sysout, stderr) = sh.execute(*status_cmd, check_exit_code=False, run_as_root=True) st = comp.STATUS_UNKNOWN combined = (sysout + stderr).lower() if utils.has_any(combined, 'nodedown', "unable to connect to node", 'unrecognized'): st = comp.STATUS_STOPPED elif combined.find('running_applications') != -1: st = comp.STATUS_STARTED return [ comp.ProgramStatus(status=st, details=(sysout + stderr).strip()), ]
def get_option(self, option, *options, **kwargs): if option == 'db': src = { option: { 'host': 'localhost', 'port': 3306, 'type': 'mysql', 'user': '******' }, } elif option == 'ip': return utils.get_host_ip() elif utils.has_any(option, 'extra_flags', 'extra_opts', 'instances_path'): return '' else: # Make a fake dictionary hierachy src = make_fakey([option] + list(options)) return utils.get_deep(src, [option] + list(options))
def statii(self): # This has got to be the worst status output. # # I have ever seen (its like a weird mix json+crap) (sysout, stderr) = self._run_action('status', check_exit_code=False) st = bruntime.STATUS_UNKNOWN combined = (sysout + stderr).lower() if utils.has_any(combined, 'nodedown', "unable to connect to node", 'unrecognized'): st = bruntime.STATUS_STOPPED elif combined.find('running_applications') != -1: st = bruntime.STATUS_STARTED return [ bruntime.ProgramStatus(status=st, details={ 'STDOUT': sysout, 'STDERR': stderr }) ]
def _filter_pip_requires_line(self, fn, line): # We handle these ourselves in anvil if utils.has_any(line.lower(), 'quantumclient', 'cinder', 'glance', 'ldap', 'keystoneclient'): return None return line
def _filter_pip_requires_line(self, fn, line): # We handle these ourselves in anvil if utils.has_any(line.lower(), 'quantumclient', 'cinder', 'glance', 'ldap'): return None return line
def _filter_pip_requires(self, fn, lines): return [l for l in lines if not utils.has_any(l.lower(), 'keystoneclient', 'ldap', 'http://tarballs.openstack.org', 'memcached')]
def _filter_pip_requires_line(self, fn, line): if utils.has_any(line.lower(), 'quantumclient', 'glance'): return None return line
def _filter_pip_requires_line(self, fn, line): if utils.has_any(line.lower(), "keystoneclient", "ldap", "http://tarballs.openstack.org", "memcached"): return None return line
def _filter_pip_requires_line(self, fn, line): if utils.has_any(line.lower(), 'swift', 'keystoneclient'): return None return line
def _filter_pip_requires(self, fn, lines): return [l for l in lines if not utils.has_any(l.lower(), 'quantumclient', 'cinder', 'glance', 'ldap', 'keystoneclient')]
def _filter_pip_requires(self, fn, lines): return [ l for l in lines if not utils.has_any(l.lower(), "quantumclient", "cinder", "glance", "ldap", "keystoneclient") ]
def _filter_pip_requires(self, fn, lines): return [l for l in lines if not utils.has_any(l.lower(), 'swift', 'keystoneclient')]
def _filter_pip_requires(self, fn, lines): return [ l for l in lines if not utils.has_any(l.lower(), 'keystoneclient', 'ldap', 'http://tarballs.openstack.org', 'memcached') ]
def _filter_pip_requires(self, fn, lines): return [ l for l in lines if not utils.has_any(l.lower(), 'quantumclient', 'cinder', 'glance', 'ldap', 'keystoneclient') ]
def _filter_pip_requires_line(self, fn, line): # We handle these ourselves in anvil if utils.has_any(line.lower(), "quantumclient", "cinder", "glance", "ldap"): return None return line
def _filter_pip_requires_line(self, fn, line): if utils.has_any(line.lower(), 'keystoneclient', 'ldap', 'http://tarballs.openstack.org', 'memcached'): return None return line