コード例 #1
0
ファイル: glance.py プロジェクト: livesourav/Openstack-Anvil
 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
コード例 #2
0
 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
コード例 #3
0
    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
コード例 #4
0
ファイル: openvswitch.py プロジェクト: AsherBond/anvil
    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
コード例 #5
0
ファイル: horizon.py プロジェクト: geekswagg/Openstack-Anvil
 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()),
     ]
コード例 #6
0
ファイル: rabbit.py プロジェクト: nsavin/Openstack-Anvil
 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})]
コード例 #7
0
 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()),
     ]
コード例 #8
0
ファイル: db.py プロジェクト: gerardo8a/Openstack-Anvil
 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()),
     ]
コード例 #9
0
 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()),
     ]
コード例 #10
0
ファイル: horizon.py プロジェクト: apugachev-gd/anvil
 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,
                                }),
     ]
コード例 #11
0
ファイル: db.py プロジェクト: apugachev-gd/anvil
 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,
                            }),
     ]
コード例 #12
0
ファイル: db.py プロジェクト: jaybuff/Openstack-Anvil
 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,
                            }),
     ]
コード例 #13
0
ファイル: rabbit.py プロジェクト: gerardo8a/Openstack-Anvil
 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()),
     ]
コード例 #14
0
ファイル: horizon.py プロジェクト: apugachev-gd/anvil
 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,
                            }),
     ]
コード例 #15
0
ファイル: rabbit.py プロジェクト: yiyinianhua/Openstack-Anvil
 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()),
     ]
コード例 #16
0
 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))
コード例 #17
0
ファイル: rabbit.py プロジェクト: AsherBond/anvil
 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
                                })
     ]
コード例 #18
0
 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))
コード例 #19
0
ファイル: rabbit.py プロジェクト: hshah19/anvil
 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
                                })
     ]
コード例 #20
0
 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
コード例 #21
0
ファイル: nova.py プロジェクト: gerardo8a/Openstack-Anvil
 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
コード例 #22
0
 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')]
コード例 #23
0
ファイル: nova.py プロジェクト: livesourav/Openstack-Anvil
 def _filter_pip_requires_line(self, fn, line):
     if utils.has_any(line.lower(), 'quantumclient', 'glance'):
         return None
     return line
コード例 #24
0
ファイル: keystone.py プロジェクト: jeffbudz/Openstack-Anvil
 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
コード例 #25
0
ファイル: glance.py プロジェクト: yiyinianhua/Openstack-Anvil
 def _filter_pip_requires_line(self, fn, line):
     if utils.has_any(line.lower(), 'swift', 'keystoneclient'):
         return None
     return line
コード例 #26
0
ファイル: nova.py プロジェクト: apugachev-gd/Openstack-Anvil
 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')]
コード例 #27
0
ファイル: glance.py プロジェクト: gerardo8a/Openstack-Anvil
 def _filter_pip_requires_line(self, fn, line):
     if utils.has_any(line.lower(), 'swift', 'keystoneclient'):
         return None
     return line
コード例 #28
0
ファイル: nova.py プロジェクト: nsavin/Openstack-Anvil
 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")
     ]
コード例 #29
0
 def _filter_pip_requires(self, fn, lines):
     return [l for l in lines
             if not utils.has_any(l.lower(), 'swift', 'keystoneclient')]
コード例 #30
0
 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')
     ]
コード例 #31
0
 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')
     ]
コード例 #32
0
ファイル: nova.py プロジェクト: jeffbudz/Openstack-Anvil
 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
コード例 #33
0
 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
コード例 #34
0
ファイル: glance.py プロジェクト: mgosalia/Openstack-Anvil
 def _filter_pip_requires(self, fn, lines):
     return [l for l in lines
             if not utils.has_any(l.lower(), 'swift', 'keystoneclient')]
コード例 #35
0
ファイル: keystone.py プロジェクト: timjr/Openstack-Anvil
 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