kargo.common.get_logger

Here are the examples of the python api kargo.common.get_logger taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

Example 1

Project: kargo-cli Source File: deploy.py
Function: init
    def __init__(self, options):
        self.existing_ssh_agent = False
        self.options = options
        self.inventorycfg = options['inventory_path']
        self.logger = get_logger(
            options.get('logfile'),
            options.get('loglevel')
        )
        self.logger.debug(
            'Running ansible-playbook command with the following options: %s'
            % self.options
        )

Example 2

Project: kargo-cli Source File: inventory.py
Function: init
    def __init__(self, options, platform):
        self.options = options
        self.platform = platform
        self.inventorycfg = options['inventory_path']
        self.logger = get_logger(options.get('logfile'), options.get('loglevel'))
        self.cparser = configparser.ConfigParser(allow_no_value=True)
        self.inventory = {'all': {'hosts': []},
                          'kube-master': {'hosts': []},
                          'etcd': {'hosts': []},
                          'kube-node': {'hosts': []},
                          'k8s-cluster:children': {'hosts': [
                              {'hostname': 'kube-node', 'hostvars': []},
                              {'hostname': 'kube-master', 'hostvars': []}
                          ]},
                          }

Example 3

Project: kargo-cli Source File: cloud.py
Function: init
    def __init__(self, options, cloud):
        self.options = options
        self.cloud = cloud
        self.inventorycfg = options['inventory_path']
        self.playbook = os.path.join(options['kargo_path'], 'local.yml')
        self.cparser = configparser.ConfigParser(allow_no_value=True)
        self.Cfg = CfgInventory(options, cloud)
        self.localcfg = os.path.join(
            options['kargo_path'],
            'inventory/local.cfg'
        )
        self.instances = {'masters':
                          {'file': os.path.join(
                           options['kargo_path'], 'masters_instances.json'),
                           'json': None
                           },
                          'nodes':
                          {'file': os.path.join(
                           options['kargo_path'], 'nodes_instances.json'),
                           'json': None
                           },
                          'etcds':
                          {'file': os.path.join(
                           options['kargo_path'], 'etcds_instances.json'),
                           'json': None
                           },
                          }
        self.logger = get_logger(
            options.get('logfile'),
            options.get('loglevel')
        )
        self.pbook_content = [{
            'gather_facts': False,
            'hosts': 'localhost',
            'become': False,
            'tasks': []
        }]
        self.logger.debug('''
             The following options were used to generate the inventory: %s
             ''' % self.options)