def directory_attributes(cloudify_agent): if not cloudify_agent.get('agent_dir'): name = cloudify_agent['name'] basedir = cloudify_agent['basedir'] if cloudify_agent['windows']: agent_dir = '{0}\\{1}'.format(basedir, name) else: agent_dir = os.path.join(basedir, name) cloudify_agent['agent_dir'] = agent_dir if not cloudify_agent.get('workdir'): agent_dir = cloudify_agent['agent_dir'] if cloudify_agent['windows']: workdir = '{0}\\{1}'.format(agent_dir, 'work') else: workdir = os.path.join(agent_dir, 'work') cloudify_agent['workdir'] = workdir if not cloudify_agent.get('envdir'): agent_dir = cloudify_agent['agent_dir'] if cloudify_agent['windows']: envdir = '{0}\\{1}'.format(agent_dir, 'env') else: envdir = os.path.join(agent_dir, 'env') cloudify_agent['envdir'] = envdir if not cloudify_agent.get('agent_rest_cert_path'): cloudify_agent['agent_rest_cert_path'] = \ cloudify_utils.get_agent_rest_cert_path() if not cloudify_agent.get('broker_ssl_cert_path'): cloudify_agent['broker_ssl_cert_path'] = \ cloudify_utils.get_broker_ssl_cert_path()
def directory_attributes(cloudify_agent): if not cloudify_agent.get('agent_dir'): name = cloudify_agent['name'] basedir = cloudify_agent['basedir'] if cloudify_agent['windows']: agent_dir = '{0}\\{1}'.format(basedir, name) else: agent_dir = os.path.join(basedir, name) cloudify_agent['agent_dir'] = agent_dir if not cloudify_agent.get('workdir'): agent_dir = cloudify_agent['agent_dir'] if cloudify_agent['windows']: workdir = '{0}\\{1}'.format(agent_dir, 'work') else: workdir = os.path.join(agent_dir, 'work') cloudify_agent['workdir'] = workdir if not cloudify_agent.get('envdir'): agent_dir = cloudify_agent['agent_dir'] if cloudify_agent['windows']: envdir = '{0}\\{1}'.format(agent_dir, 'env') else: envdir = os.path.join(agent_dir, 'env') cloudify_agent['envdir'] = envdir if not cloudify_agent.get('broker_ssl_cert_path'): cloudify_agent['broker_ssl_cert_path'] = \ cloudify_utils.get_broker_ssl_cert_path()
def _get_defaults(manager_version): broker_config = BootstrapContext(ctx.bootstrap_context).broker_config() if not broker_config.get('broker_ssl_cert'): with open(get_broker_ssl_cert_path(), 'r') as f: broker_config['broker_ssl_cert'] = f.read() return { 'version': str(manager_version), 'broker_config': broker_config }
def set_config_paths(self): join = nt_join if self.is_windows else posix_join if not self.get('agent_dir'): self['agent_dir'] = join(self['basedir'], self['name']) if not self.get('workdir'): self['workdir'] = join(self['agent_dir'], 'work') if not self.get('envdir'): self['envdir'] = join(self['agent_dir'], 'env') if not self.get('broker_ssl_cert_path'): self['broker_ssl_cert_path'] = \ cloudify_utils.get_broker_ssl_cert_path()
def set_config_paths(self): # proxied agents don't have a name - don't set paths either if self.is_proxied: return join = nt_join if self.is_windows else posix_join if not self.get('agent_dir'): self['agent_dir'] = join(self['basedir'], self['name']) if not self.get('workdir'): self['workdir'] = join(self['agent_dir'], 'work') if not self.get('envdir'): self['envdir'] = join(self['agent_dir'], 'env') if not self.get('broker_ssl_cert_path'): self['broker_ssl_cert_path'] = \ cloudify_utils.get_broker_ssl_cert_path()
def set_config_paths(self): # proxied agents don't have a name - don't set paths either if self.is_proxied: return join = nt_join if self.is_windows else posix_join if not self.get('agent_dir'): self['agent_dir'] = join(self['basedir'], self['name']) if not self.get('workdir'): self['workdir'] = join(self['agent_dir'], 'work') if not self.get('envdir'): self['envdir'] = join(self['agent_dir'], 'env') if not self.get('broker_ssl_cert_path'): self['broker_ssl_cert_path'] = \ cloudify_utils.get_broker_ssl_cert_path()
def __init__(self): with open(get_broker_ssl_cert_path(), 'r') as f: self._broker_ssl_cert = f.read() self._manager_version = None
def __init__(self): with open(get_broker_ssl_cert_path(), 'r') as f: self._broker_ssl_cert = f.read()
def __init__(self): with open(get_broker_ssl_cert_path(), 'r') as f: self._broker_ssl_cert = f.read() self._manager_version = None