コード例 #1
0
    def get_node_ip(self, node_name):
        node = self.get_node(name=node_name)
        node_mac = node.interfaces[0].mac_address

        nailgun_client = nailgun.NailgunClient(ip=self.get_admin_ip())
        ip = nailgun_client.get_slave_ip_by_mac(node_mac)
        return ip
コード例 #2
0
def get_nodes(admin_ip):
    msg = ('get_nodes has been deprecated in favor of '
           'NailgunClient.get_nodes_json')
    logger.warning(msg)
    warnings.warn(msg, DeprecationWarning)

    from devops.client import nailgun
    ng_client = nailgun.NailgunClient(ip=admin_ip)
    return ng_client.get_nodes_json()
コード例 #3
0
def get_slave_ip(env, node_mac_address):
    msg = ('get_slave_ip has been deprecated in favor of '
           'DevopsEnvironment.get_node_ip')
    logger.warning(msg)
    warnings.warn(msg, DeprecationWarning)

    from devops import client
    from devops.client import nailgun
    denv = client.DevopsClient().get_env(env.name)
    ng_client = nailgun.NailgunClient(ip=denv.get_admin_ip())
    return ng_client.get_slave_ip_by_mac(node_mac_address)
コード例 #4
0
    def setUp(self):
        super(TestNailgunClient, self).setUp()

        self.v2pass_mock = self.patch('devops.client.nailgun.V2Password',
                                      spec=V2Password)
        self.v2pass_inst = self.v2pass_mock.return_value
        self.ks_session_mock = self.patch(
            'devops.client.nailgun.KeystoneSession', spec=KeystoneSession)
        self.k2_session_inst = self.ks_session_mock.return_value
        self.nodes_mock = self.k2_session_inst.get.return_value

        self.nc = nailgun.NailgunClient('10.109.0.2')