Exemplo n.º 1
0
 def do_check_software(cls, system_packages=None):
     requirements = None
     if linux.os.debian_family:
         requirements = [
             ["mariadb-server>=5.5,<5.6", "mariadb-client>=5.5,<5.6"],
             ["mariadb-server>=5.5,<5.6", "mariadb-client-5.5"],
         ]
     elif linux.os.redhat_family or linux.os.oracle_family:
         requirements = [["mariadb-server>=5.5,<5.6"], ["MariaDB-server>=5.5,<5.6", "MariaDB-client>=5.5,<5.6"]]
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
             cls.behavior, "Not supported on {0} os family".format(linux.os["family"])
         )
     errors = list()
     for requirement in requirements:
         try:
             installed = pkgmgr.check_software(requirement[0], system_packages)[0]
             try:
                 pkgmgr.check_software(requirement[1:], system_packages)
                 return installed
             except pkgmgr.NotInstalledError:
                 e = sys.exc_info()[1]
                 raise SoftwareDependencyError(e.args[0])
         except:
             e = sys.exc_info()[1]
             errors.append(e)
     for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
         for error in errors:
             if isinstance(error, cls):
                 raise error
Exemplo n.º 2
0
 def do_check_software(cls, system_packages=None):
     requirements = None
     if linux.os.debian_family:
         requirements = [
             ['mariadb-server>=5.5,<5.6', 'mariadb-client>=5.5,<5.6'],
             ['mariadb-server>=5.5,<5.6', 'mariadb-client-5.5'],
         ]
     elif linux.os.redhat_family or linux.os.oracle_family:
         requirements = [
             ['mariadb-server>=5.5,<5.6'],
             ['MariaDB-server>=5.5,<5.6', 'MariaDB-client>=5.5,<5.6'],
         ]
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
     errors = list()
     for requirement in requirements:
         try:
             installed = pkgmgr.check_software(requirement[0], system_packages)[0]
             try:
                 pkgmgr.check_software(requirement[1:], system_packages)
                 return installed
             except pkgmgr.NotInstalledError:
                 e = sys.exc_info()[1]
                 raise SoftwareDependencyError(e.args[0])
         except:
             e = sys.exc_info()[1]
             errors.append(e)
     for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
         for error in errors:
             if isinstance(error, cls):
                 raise error
Exemplo n.º 3
0
    def do_check_software(cls, system_packages=None):
        os_name = linux.os['name'].lower()
        os_vers = linux.os['version']
        requirements = None
        if os_name == 'ubuntu' and os_vers >= '14':
            requirements = [
                ['percona-server-server-5.1', 'percona-server-client-5.1'],
                ['percona-server-server-5.5', 'percona-server-client-5.5'],
                ['percona-server-server-5.6', 'percona-server-client-5.6'],
            ]
        elif linux.os.debian_family:
            requirements = [
                ['percona-server-server-5.1', 'percona-server-client-5.1'],
                ['percona-server-server-5.5', 'percona-server-client-5.5'],
            ]
        elif linux.os.redhat_family or linux.os.oracle_family:
            if os_vers >= '7' and not linux.os.amazon:
                requirements = [[
                    'Percona-Server-server-56', 'Percona-Server-client-56'
                ]]
            else:
                requirements = [[
                    'Percona-Server-server-51', 'Percona-Server-client-51'
                ], ['Percona-Server-server-55', 'Percona-Server-client-55']]

        if requirements is None:
            raise exceptions.UnsupportedBehavior(
                cls.behavior,
                "Not supported on {0} os family".format(linux.os['family']))
        errors = list()
        for requirement in requirements:
            try:
                installed = pkgmgr.check_software(requirement[0],
                                                  system_packages)[0]
                try:
                    pkgmgr.check_software(requirement[1:], system_packages)
                    return installed
                except pkgmgr.NotInstalledError:
                    e = sys.exc_info()[1]
                    raise SoftwareDependencyError(e.args[0])
            except:
                e = sys.exc_info()[1]
                errors.append(e)
        for cls in [
                pkgmgr.VersionMismatchError, SoftwareDependencyError,
                pkgmgr.NotInstalledError
        ]:
            for error in errors:
                if isinstance(error, cls):
                    raise error
Exemplo n.º 4
0
 def do_check_software(cls, system_packages=None):
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         if os_vers >= '14':
             requirements = ['redis-server>=2.6,<2.9']
         elif os_vers >= '12':
             requirements = ['redis-server>=2.2,<2.9']
         elif os_vers >= '10':
             requirements = ['redis-server>=2.2,<2.3']
     elif os_name == 'debian':
         if os_vers >= '7':
             requirements = ['redis-server>=2.6,<2.9']
         elif os_vers >= '6':
             requirements = ['redis-server>=2.6,<2.7']
     elif linux.os.oracle_family or os_name == 'redhat' or os_name == 'centos':
         requirements = ['redis>=2.4,<2.9']
     elif os_name == 'amazon':
         if os_vers >= '2014':
             requirements = ['redis>=2.8,<2.9']
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
     return pkgmgr.check_software(requirements, system_packages)[0]
Exemplo n.º 5
0
 def do_check_software(cls, system_packages=None):
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         if os_vers >= '14':
             requirements = ['redis-server>=2.6,<2.9']
         elif os_vers >= '12':
             requirements = ['redis-server>=2.2,<2.9']
         elif os_vers >= '10':
             requirements = ['redis-server>=2.2,<2.3']
     elif os_name == 'debian':
         if os_vers >= '7':
             requirements = ['redis-server>=2.6,<2.9']
         elif os_vers >= '6':
             requirements = ['redis-server>=2.6,<2.7']
     elif linux.os.oracle_family or os_name == 'redhat' or os_name == 'centos':
         requirements = ['redis>=2.4,<2.9']
     elif os_name == 'amazon':
         if os_vers >= '2014':
             requirements = ['redis>=2.8,<2.9']
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
             cls.behavior,
             "Not supported on {0} os family".format(linux.os['family']))
     return pkgmgr.check_software(requirements, system_packages)[0]
Exemplo n.º 6
0
    def do_check_software(cls, system_packages=None):
        os_name = linux.os['name'].lower()
        os_vers = linux.os['version']
        requirements = None
        if os_name == 'ubuntu' and os_vers >= '14':
            requirements = [
                ['percona-server-server-5.1', 'percona-server-client-5.1' ],
                ['percona-server-server-5.5', 'percona-server-client-5.5' ],
                ['percona-server-server-5.6', 'percona-server-client-5.6' ],
            ]
        elif linux.os.debian_family:
            requirements = [
                ['percona-server-server-5.1', 'percona-server-client-5.1'],
                ['percona-server-server-5.5', 'percona-server-client-5.5'],
            ]
        elif linux.os.redhat_family or linux.os.oracle_family:
            if os_vers >= '7' and not linux.os.amazon:
                requirements = [
                    ['Percona-Server-server-56', 'Percona-Server-client-56']                    
                ]
            else:
                requirements = [
                    ['Percona-Server-server-51', 'Percona-Server-client-51'],
                    ['Percona-Server-server-55', 'Percona-Server-client-55']
                ]

        if requirements is None:
            raise exceptions.UnsupportedBehavior(
                    cls.behavior,
                    "Not supported on {0} os family".format(linux.os['family']))
        errors = list()
        for requirement in requirements:
            try:
                installed = pkgmgr.check_software(requirement[0], system_packages)[0]
                try:
                    pkgmgr.check_software(requirement[1:], system_packages)
                    return installed
                except pkgmgr.NotInstalledError:
                    e = sys.exc_info()[1]
                    raise SoftwareDependencyError(e.args[0])
            except:
                e = sys.exc_info()[1]
                errors.append(e)
        for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
            for error in errors:
                if isinstance(error, cls):
                    raise error
Exemplo n.º 7
0
 def do_check_software(cls, system_packages=None):
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     if cls.catalina_home_dir():
         return
     if linux.os.debian_family:
         requirements_main = None
         if os_name == 'ubuntu':
             if os_vers >= '12':
                 requirements_main = ['tomcat7']
                 requirements_dependencies = ['tomcat7-admin']
             elif os_vers >= '10':
                 requirements_main = ['tomcat6']
                 requirements_dependencies = ['tomcat6-admin']
         elif os_name == 'debian':
             if os_vers >= '7':
                 requirements_main = ['tomcat7']
                 requirements_dependencies = ['tomcat7-admin']
             elif os_vers >= '6':
                 requirements_main = ['tomcat6']
                 requirements_dependencies = ['tomcat6-admin']
         if requirements_main is None:
             raise exceptions.UnsupportedBehavior(
                     cls.behavior,
                     "Not supported on {0} os family".format(linux.os['family']))
         installed = pkgmgr.check_software(requirements_main, system_packages)[0]
         try:
             pkgmgr.check_software(requirements_dependencies, system_packages)
             return installed
         except pkgmgr.NotInstalledError:
             e = sys.exc_info()[1]
             raise SoftwareDependencyError(e.args[0])
     elif linux.os.redhat_family or linux.os.oracle_family:
         requirements = [
             ['tomcat', 'tomcat-admin-webapps'],
             ['tomcat6', 'tomcat6-admin-webapps'],
             ['tomcat7', 'tomcat7-admin-webapps'],
         ]
         errors = list()
         for requirement in requirements:
             try:
                 installed = pkgmgr.check_software(requirement[0], system_packages)[0]
                 try:
                     pkgmgr.check_software(requirement[1:], system_packages)
                     return installed
                 except pkgmgr.NotInstalledError:
                     e = sys.exc_info()[1]
                     raise SoftwareDependencyError(e.args[0])
             except:
                 e = sys.exc_info()[1]
                 errors.append(e)
         for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
             for error in errors:
                 if isinstance(error, cls):
                     raise error
     else:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
Exemplo n.º 8
0
 def do_check_software(cls, system_packages=None):
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         requirements = ['rabbitmq-server>=2.6,<3.7']
     elif os_name == 'debian':
         requirements = ['rabbitmq-server>=3.0,<3.7']
     elif linux.os.redhat_family:
         if os_vers >= '6':
             requirements = ['rabbitmq-server>=3.1,<3.7']
         elif os_vers >= '5':
             raise exceptions.UnsupportedBehavior(
                 cls.behavior, "Not supported by Scalr on {0} {1}".format(
                     linux.os['name'], linux.os['version']))
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
             cls.behavior,
             "Not supported on {0} os family".format(linux.os['family']))
     return pkgmgr.check_software(requirements, system_packages)[0]
Exemplo n.º 9
0
 def do_check_software(cls, system_packages=None):
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         requirements = ['rabbitmq-server>=2.6,<3.5']
     elif os_name == 'debian':
         requirements = ['rabbitmq-server>=3.0,<3.5']
     elif linux.os.redhat_family:
         if os_vers >= '6':
             requirements = ['rabbitmq-server>=3.1,<3.5']
         elif os_vers >= '5':
             raise exceptions.UnsupportedBehavior(
                     cls.behavior,
                     "Not supported by Scalr on {0} {1}".format(linux.os['name'], linux.os['version']))
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
     return pkgmgr.check_software(requirements, system_packages)[0]
Exemplo n.º 10
0
 def _check_pigz(self):
     try:
         pkgmgr.check_software(['pigz'])
     except pkgmgr.SoftwareError:
         pkgmgr.epel_repository()
         pkgmgr.installed('pigz', updatedb=True)
Exemplo n.º 11
0
 def do_check_software(cls, system_packages=None):
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         if os_vers >= '12':
             requirements = [
                 ['postgresql-9.1', 'postgresql-client-9.1'],
                 ['postgresql-9.2', 'postgresql-client-9.2'],
                 ['postgresql-9.3', 'postgresql-client-9.3'],
                 ['postgresql>=9.1,<9.4', 'postgresql-client>=9.1,<9.4'],
             ]
         elif os_vers >= '10':
             requirements = [
                 ['postgresql-9.0', 'postgresql-client-9.0'],
                 ['postgresql-9.1', 'postgresql-client-9.1'],
                 ['postgresql-9.2', 'postgresql-client-9.2'],
                 ['postgresql-9.3', 'postgresql-client-9.3'],
                 ['postgresql>=9.0,<9.4', 'postgresql-client>=9.0,<9.4'],
             ]
     elif os_name == 'debian':
         requirements = [
             ['postgresql-9.2', 'postgresql-client-9.2'],
             ['postgresql-9.3', 'postgresql-client-9.3'],
             ['postgresql>=9.2,<9.4', 'postgresql-client>=9.2,<9.4'],
         ]
     elif linux.os.redhat_family:
         if os_vers >= '6':
             requirements = [
                 ['postgresql91-server', 'postgresql91', 'postgresql91-devel'],
                 ['postgresql92-server', 'postgresql92', 'postgresql92-devel'],
                 ['postgresql93-server', 'postgresql93', 'postgresql93-devel'],
                 ['postgresql-server>=9.1,<9.4', 'postgresql>=9.1,<9.4', 'postgresql-devel>=9.1,<9.4'],
             ]
         elif os_vers >= '5':
             requirements = [
                 ['postgresql90-server', 'postgresql90', 'postgresql90-devel'],
                 ['postgresql91-server', 'postgresql91', 'postgresql91-devel'],
                 ['postgresql92-server', 'postgresql92', 'postgresql92-devel'],
                 ['postgresql93-server', 'postgresql93', 'postgresql93-devel'],
                 ['postgresql-server>=9.0,<9.4', 'postgresql>=9.0,<9.4', 'postgresql-devel>=9.0,<9.4'],
             ]
     elif linux.os.oracle_family:
         requirements = [
             ['postgresql92-server', 'postgresql92', 'postgresql92-devel'],
             ['postgresql-server>=9.2,<9.3', 'postgresql>=9.2,<9.3', 'postgresql-devel>=9.2,<9.3'],
         ]
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
     errors = list()
     for requirement in requirements:
         try:
             installed = pkgmgr.check_software(requirement[0], system_packages)[0]
             try:
                 pkgmgr.check_software(requirement[1:], system_packages)
                 return installed
             except pkgmgr.NotInstalledError:
                 e = sys.exc_info()[1]
                 raise SoftwareDependencyError(e.args[0])
         except:
             e = sys.exc_info()[1]
             errors.append(e)
     for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
         for error in errors:
             if isinstance(error, cls):
                 raise error
Exemplo n.º 12
0
 def do_check_software(cls, system_packages=None):
     return pkgmgr.check_software(['memcached'], system_packages)[0]
Exemplo n.º 13
0
 def do_check_software(cls, system_packages=None):
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         if os_vers >= '12':
             requirements = [
                 ['postgresql-9.1', 'postgresql-client-9.1'],
                 ['postgresql-9.2', 'postgresql-client-9.2'],
                 ['postgresql-9.3', 'postgresql-client-9.3'],
                 ['postgresql>=9.1,<9.4', 'postgresql-client>=9.1,<9.4'],
             ]
         elif os_vers >= '10':
             requirements = [
                 ['postgresql-9.0', 'postgresql-client-9.0'],
                 ['postgresql-9.1', 'postgresql-client-9.1'],
                 ['postgresql-9.2', 'postgresql-client-9.2'],
                 ['postgresql-9.3', 'postgresql-client-9.3'],
                 ['postgresql>=9.0,<9.4', 'postgresql-client>=9.0,<9.4'],
             ]
     elif os_name == 'debian':
         requirements = [
             ['postgresql-9.2', 'postgresql-client-9.2'],
             ['postgresql-9.3', 'postgresql-client-9.3'],
             ['postgresql>=9.2,<9.4', 'postgresql-client>=9.2,<9.4'],
         ]
     elif linux.os.redhat_family:
         if os_vers >= '6':
             requirements = [
                 ['postgresql91-server', 'postgresql91', 'postgresql91-devel'],
                 ['postgresql92-server', 'postgresql92', 'postgresql92-devel'],
                 ['postgresql93-server', 'postgresql93', 'postgresql93-devel'],
                 ['postgresql-server>=9.1,<9.4', 'postgresql>=9.1,<9.4', 'postgresql-devel>=9.1,<9.4'],
             ]
         elif os_vers >= '5':
             requirements = [
                 ['postgresql90-server', 'postgresql90', 'postgresql90-devel'],
                 ['postgresql91-server', 'postgresql91', 'postgresql91-devel'],
                 ['postgresql92-server', 'postgresql92', 'postgresql92-devel'],
                 ['postgresql93-server', 'postgresql93', 'postgresql93-devel'],
                 ['postgresql-server>=9.0,<9.4', 'postgresql>=9.0,<9.4', 'postgresql-devel>=9.0,<9.4'],
             ]
     elif linux.os.oracle_family:
         requirements = [
             ['postgresql92-server', 'postgresql92', 'postgresql92-devel'],
             ['postgresql-server>=9.2,<9.3', 'postgresql>=9.2,<9.3', 'postgresql-devel>=9.2,<9.3'],
         ]
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
     errors = list()
     for requirement in requirements:
         try:
             installed = pkgmgr.check_software(requirement[0], system_packages)[0]
             try:
                 pkgmgr.check_software(requirement[1:], system_packages)
                 return installed
             except pkgmgr.NotInstalledError:
                 e = sys.exc_info()[1]
                 raise SoftwareDependencyError(e.args[0])
         except:
             e = sys.exc_info()[1]
             errors.append(e)
     for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
         for error in errors:
             if isinstance(error, cls):
                 raise error
Exemplo n.º 14
0
 def do_check_software(cls, system_packages=None):
     """
     Asserts MongoDB version.
     """
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         if os_vers >= '14':
             requirements = [
                 ['mongodb-org>=2.4,<2.7'],
                 [
                     'mongodb-org-server>=2.4,<2.7',
                     'mongodb-org-mongos>=2.4,<2.7',
                     'mongodb-org-shell>=2.4,<2.7',
                     'mongodb-org-tools>=2.4,<2.7',
                 ],
                 ['mongodb-10gen>=2.4,<2.7'],
                 ['mongodb>=2.4,<2.7']
             ]
         elif os_vers >= '12':
             requirements = [
                 ['mongodb-org>=2.0,<2.7'],
                 [
                     'mongodb-org-server>=2.0,<2.7',
                     'mongodb-org-mongos>=2.0,<2.7',
                     'mongodb-org-shell>=2.0,<2.7',
                     'mongodb-org-tools>=2.0,<2.7',
                 ],
                 ['mongodb-10gen>=2.0,<2.7'],
                 ['mongodb20-10gen'],
                 ['mongodb>=2.0,<2.7']
             ]
         elif os_vers >= '10':
             requirements = [
                 ['mongodb-10gen>=2.0,<2.1'],
                 ['mongodb20-10gen'],
                 ['mongodb>=2.0,<2.1']
             ]
     elif os_name == 'debian':
         if os_vers >= '7':
             requirements = [
                 ['mongodb-org>=2.4,<2.7'],
                 [
                     'mongodb-org-server>=2.4,<2.7',
                     'mongodb-org-mongos>=2.4,<2.7',
                     'mongodb-org-shell>=2.4,<2.7',
                     'mongodb-org-tools>=2.4,<2.7',
                 ],
                 ['mongodb-10gen>=2.4,<2.7'],
                 ['mongodb>=2.4,<2.7']
             ]
         elif os_vers >= '6':
             requirements = [
                 ['mongodb-10gen>=2.4,<2.5'],
                 ['mongodb>=2.4,<2.5']
             ]
     elif os_name == 'centos':
         if os_vers >= '6':
             requirements = [
                 ['mongodb-org>=2.0,<2.7'],
                 [
                     'mongodb-org-server>=2.4,<2.7',
                     'mongodb-org-mongos>=2.4,<2.7',
                     'mongodb-org-shell>=2.4,<2.7',
                     'mongodb-org-tools>=2.4,<2.7',
                 ],
                 ['mongo-10gen-server>=2.0,<2.7'],
                 ['mongo20-10gen-server>=2.0,<3'],
                 ['mongodb-server>=2.0,<2.7']
             ]
         elif os_vers >= '5':
             requirements = [
                 ['mongo-10gen-server>=2.0,<2.1'],
                 ['mongo20-10gen-server>=2.0,<3'],
                 ['mongodb-server>=2.0,<2.1']
             ]
     elif linux.os.redhat_family:
         requirements = [
             ['mongodb-org>=2.4,<2.7'],
             [
                 'mongodb-org-server>=2.4,<2.7',
                 'mongodb-org-mongos>=2.4,<2.7',
                 'mongodb-org-shell>=2.4,<2.7',
                 'mongodb-org-tools>=2.4,<2.7',
             ],
             ['mongo-10gen-server>=2.4,<2.7'],
             ['mongodb-server>=2.4,<2.7']
         ]
     elif linux.os.oracle_family:
         requirements = [
             ['mongodb-org>=2.0,<2.1'],
             ['mongo-10gen-server>=2.0,<2.1'],
             ['mongo20-10gen-server>=2.0,<3'],
             ['mongodb-server>=2.0,<2.1']
         ]
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
     errors = list()
     for requirement in requirements:
         try:
             installed = pkgmgr.check_software(requirement[0], system_packages)[0]
             try:
                 pkgmgr.check_software(requirement[1:], system_packages)
                 return installed
             except pkgmgr.NotInstalledError:
                 e = sys.exc_info()[1]
                 raise SoftwareDependencyError(e.args[0])
         except:
             e = sys.exc_info()[1]
             errors.append(e)
     for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
         for error in errors:
             if isinstance(error, cls):
                 raise error
Exemplo n.º 15
0
 def do_check_software(cls, system_packages=None):
     return pkgmgr.check_software(['memcached'], system_packages)[0]
Exemplo n.º 16
0
 def do_check_software(cls, system_packages=None):
     """
     Asserts MongoDB version.
     """
     os_name = linux.os['name'].lower()
     os_vers = linux.os['version']
     requirements = None
     if os_name == 'ubuntu':
         if os_vers >= '14':
             requirements = [
                 ['mongodb-org>=2.4,<2.7'],
                 [
                     'mongodb-org-server>=2.4,<2.7',
                     'mongodb-org-mongos>=2.4,<2.7',
                     'mongodb-org-shell>=2.4,<2.7',
                     'mongodb-org-tools>=2.4,<2.7',
                 ],
                 ['mongodb-10gen>=2.4,<2.7'],
                 ['mongodb>=2.4,<2.7']
             ]
         elif os_vers >= '12':
             requirements = [
                 ['mongodb-org>=2.0,<2.7'],
                 [
                     'mongodb-org-server>=2.0,<2.7',
                     'mongodb-org-mongos>=2.0,<2.7',
                     'mongodb-org-shell>=2.0,<2.7',
                     'mongodb-org-tools>=2.0,<2.7',
                 ],
                 ['mongodb-10gen>=2.0,<2.7'],
                 ['mongodb20-10gen'],
                 ['mongodb>=2.0,<2.7']
             ]
         elif os_vers >= '10':
             requirements = [
                 ['mongodb-10gen>=2.0,<2.1'],
                 ['mongodb20-10gen'],
                 ['mongodb>=2.0,<2.1']
             ]
     elif os_name == 'debian':
         if os_vers >= '7':
             requirements = [
                 ['mongodb-org>=2.4,<2.7'],
                 [
                     'mongodb-org-server>=2.4,<2.7',
                     'mongodb-org-mongos>=2.4,<2.7',
                     'mongodb-org-shell>=2.4,<2.7',
                     'mongodb-org-tools>=2.4,<2.7',
                 ],
                 ['mongodb-10gen>=2.4,<2.7'],
                 ['mongodb>=2.4,<2.7']
             ]
         elif os_vers >= '6':
             requirements = [
                 ['mongodb-10gen>=2.4,<2.5'],
                 ['mongodb>=2.4,<2.5']
             ]
     elif os_name == 'centos':
         if os_vers >= '6':
             requirements = [
                 ['mongodb-org>=2.0,<2.7'],
                 [
                     'mongodb-org-server>=2.4,<2.7',
                     'mongodb-org-mongos>=2.4,<2.7',
                     'mongodb-org-shell>=2.4,<2.7',
                     'mongodb-org-tools>=2.4,<2.7',
                 ],
                 ['mongo-10gen-server>=2.0,<2.7'],
                 ['mongo20-10gen-server>=2.0,<3'],
                 ['mongodb-server>=2.0,<2.7']
             ]
         elif os_vers >= '5':
             requirements = [
                 ['mongo-10gen-server>=2.0,<2.1'],
                 ['mongo20-10gen-server>=2.0,<3'],
                 ['mongodb-server>=2.0,<2.1']
             ]
     elif linux.os.redhat_family:
         requirements = [
             ['mongodb-org>=2.4,<2.7'],
             [
                 'mongodb-org-server>=2.4,<2.7',
                 'mongodb-org-mongos>=2.4,<2.7',
                 'mongodb-org-shell>=2.4,<2.7',
                 'mongodb-org-tools>=2.4,<2.7',
             ],
             ['mongo-10gen-server>=2.4,<2.7'],
             ['mongodb-server>=2.4,<2.7']
         ]
     elif linux.os.oracle_family:
         requirements = [
             ['mongodb-org>=2.0,<2.1'],
             ['mongo-10gen-server>=2.0,<2.1'],
             ['mongo20-10gen-server>=2.0,<3'],
             ['mongodb-server>=2.0,<2.1']
         ]
     if requirements is None:
         raise exceptions.UnsupportedBehavior(
                 cls.behavior,
                 "Not supported on {0} os family".format(linux.os['family']))
     errors = list()
     for requirement in requirements:
         try:
             installed = pkgmgr.check_software(requirement[0], system_packages)[0]
             try:
                 pkgmgr.check_software(requirement[1:], system_packages)
                 return installed
             except pkgmgr.NotInstalledError:
                 e = sys.exc_info()[1]
                 raise SoftwareDependencyError(e.args[0])
         except:
             e = sys.exc_info()[1]
             errors.append(e)
     for cls in [pkgmgr.VersionMismatchError, SoftwareDependencyError, pkgmgr.NotInstalledError]:
         for error in errors:
             if isinstance(error, cls):
                 raise error
Exemplo n.º 17
0
 def do_check_software(cls, system_packages=None):
     return pkgmgr.check_software(['haproxy'], system_packages)[0]
Exemplo n.º 18
0
 def do_check_software(cls, system_packages=None):
     return pkgmgr.check_software(['haproxy'], system_packages)[0]