def _get_runtime_properties(self): client = utils.get_rest_client(rest_host=self.rest_host, rest_port=self.rest_port, rest_token=self._rest_token, rest_tenant=self._rest_tenant, ssl_cert_path=self.local_rest_cert_file) node_instances = client.node_instances.list( deployment_id=self.deployment_id) def match_ip(node_instance): host_id = node_instance.host_id if host_id == node_instance.id: # compute node instance return self.host == node_instance.runtime_properties['ip'] return False matched = filter(match_ip, node_instances) if len(matched) > 1: raise exceptions.DaemonConfigurationError( 'Found multiple node instances with ip {0}: {1}'.format( self.host, ','.join(matched))) if len(matched) == 0: raise exceptions.DaemonConfigurationError( 'No node instances with ip {0} were found'.format(self.host)) self._runtime_properties = matched[0].runtime_propreties
def _get_runtime_properties(self): client = utils.get_rest_client( security_enabled=self.security_enabled, rest_host=self.rest_host, rest_protocol=self.rest_protocol, rest_port=self.rest_port, rest_username=self._rest_username, rest_password=self._rest_password, rest_token=self._rest_token, verify_rest_certificate=self.verify_rest_certificate, ssl_cert_path=self.local_rest_cert_file ) node_instances = client.node_instances.list( deployment_id=self.deployment_id) def match_ip(node_instance): host_id = node_instance.host_id if host_id == node_instance.id: # compute node instance return self.host == node_instance.runtime_properties['ip'] return False matched = filter(match_ip, node_instances) if len(matched) > 1: raise exceptions.DaemonConfigurationError( 'Found multiple node instances with ip {0}: {1}'.format( self.host, ','.join(matched)) ) if len(matched) == 0: raise exceptions.DaemonConfigurationError( 'No node instances with ip {0} were found'.format(self.host) ) self._runtime_properties = matched[0].runtime_propreties
def _get_runtime_properties(self): client = utils.get_rest_client( rest_host=self.rest_host, rest_port=self.rest_port, rest_token=self._rest_token, rest_tenant=self._rest_tenant, ssl_cert_path=self.local_rest_cert_file ) node_instances = client.node_instances.list( deployment_id=self.deployment_id, _get_all_results=True) def match_ip(node_instance): host_id = node_instance.host_id if host_id == node_instance.id: # compute node instance return self.host == node_instance.runtime_properties['ip'] return False matched = filter(match_ip, node_instances) if len(matched) > 1: raise exceptions.DaemonConfigurationError( 'Found multiple node instances with ip {0}: {1}'.format( self.host, ','.join(matched)) ) if len(matched) == 0: raise exceptions.DaemonConfigurationError( 'No node instances with ip {0} were found'.format(self.host) ) self._runtime_properties = matched[0].runtime_propreties
def _get_runtime_properties(self): client = utils.get_rest_client(rest_host=self.rest_host, rest_port=self.rest_port, rest_token=self._rest_token, rest_tenant=self._rest_tenant, ssl_cert_path=self.local_rest_cert_file) node_instances = client.node_instances.list( deployment_id=self.deployment_id, _get_all_results=True) matched = [ ni for ni in node_instances if ni.host_id == ni.id and self.host == ni.runtime_properties['ip'] ] if len(matched) > 1: raise exceptions.DaemonConfigurationError( 'Found multiple node instances with ip {0}: {1}'.format( self.host, ','.join(matched))) if len(matched) == 0: raise exceptions.DaemonConfigurationError( 'No node instances with ip {0} were found'.format(self.host)) self._runtime_properties = matched[0].runtime_propreties