Exemplo n.º 1
0
    def __init__(self, packages_dict, log_name=__name__):
        """Install packages on a local Linux Operating System.

        :param packages_dict: ``dict``
        :param log_name: ``str`` This is used to log against an existing log
                                 handler.
        """
        self.log = logger.getLogger(log_name)
        self.shell = shell.ShellCommands(log_name=log_name)

        self.distro = None
        self.packages_dict = packages_dict

        self.install_process = {
            'apt':
            "apt-get update && apt-get"
            " -o Dpkg::Options:='--force-confold'"
            " -o Dpkg::Options:='--force-confdef'"
            " -y install %s",
            'yum':
            "yum -y instaall %s",
            'zypper':
            "zypper -n install %s"
        }
        self.install_string = None
Exemplo n.º 2
0
def _run_command(command):
    print('Running "%s"' % command[2])
    run_command = shell.ShellCommands(debug=True)
    info, success = run_command.run_command(' '.join(command))
    if not success:
        raise SystemExit(info)
    else:
        print(info)
Exemplo n.º 3
0
    def __init__(self, job_args):
        """

        :param job_args:
        """
        self.job_args = job_args
        self.http = http.MakeRequest()
        self.shell = shell.ShellCommands(log_name='turbolift',
                                         debug=self.job_args.get('debug'))
Exemplo n.º 4
0
    def __init__(self, job_args):
        self.job_args = job_args
        # Define the size at which objects are considered large.
        self.large_object_size = self.job_args.get('large_object_size')

        self.max_jobs = self.job_args.get('max_jobs')
        if not self.max_jobs:
            self.max_jobs = 25000

        self.job = actions.CloudActions(job_args=self.job_args)
        self.run_indicator = self.job_args.get('run_indicator', True)
        self.indicator_options = {'run': self.run_indicator}

        self.shell = shell.ShellCommands(log_name='turbolift',
                                         debug=self.job_args['debug'])

        self.excludes = self.job_args.get('exclude')
        if not self.excludes:
            self.excludes = list()
Exemplo n.º 5
0
 def __init__(self, user_args, log_object):
     self.args = user_args
     self.shell_cmds = shell.ShellCommands(log_name='repo_builder',
                                           debug=self.args['debug'])
     self.log = log_object