def install_ssh_key(self, blueprint_id): utils.upload_blueprint(SSH_KEY_BP_ZIP, blueprint_id, 'keys.yaml') utils.create_deployment(blueprint_id) utils.execute_install(blueprint_id) delete_dep_command = \ 'cfy deployments delete -f {0}'.format(blueprint_id) utils.execute_command(delete_dep_command) if not utils.get_secrets('agent_key_private') or not \ utils.get_secrets('agent_key_public'): raise Exception( 'agent_key_private or agent_key_public not in secrets')
def get_kubernetes_master_ip(self): pattern = re.compile(IP_ADDRESS_REGEX) response = eco_utils.get_secrets('kubernetes_master_ip') value = response['value'] if pattern.match(value): return value failed = eco_utils.install_nodecellar(self.blueprint_file_name, {}, KUBERNETES_BLUEPRINT_URL, 'k8s') if failed: raise Exception('Failed to install Kubernetes.') response = eco_utils.get_secrets('kubernetes_master_ip') value = response['value'] if not pattern.match(value): raise Exception('Kubernetes IP is: {0}'.format(value)) return value
def test_secrets(self): for secret in self.secrets_to_check: self.assertIsNotNone(eco_utils.get_secrets(secret))