Merge "Backslash continuations (nova.virt.baremetal)"

This commit is contained in:
Jenkins 2012-02-20 09:14:55 +00:00 committed by Gerrit Code Review
commit 9a174189b4
3 changed files with 30 additions and 30 deletions

View File

@ -127,7 +127,7 @@ class BareMetalNodes(object):
"""
pass
def activate_node(self, node_id, node_ip, name, mac_address, \
def activate_node(self, node_id, node_ip, name, mac_address,
ip_address):
"""
Activates the given node using ID, IP, and MAC address.

View File

@ -124,8 +124,8 @@ class ProxyConnection(driver.ComputeDriver):
def _map_to_instance_info(self, domain_name):
"""Gets info from a virsh domain object into an InstanceInfo"""
(state, _max_mem, _mem, _num_cpu, _cpu_time) \
= self._conn.get_domain_info(domain_name)
_domain_info = self._conn.get_domain_info(domain_name)
state, _max_mem, _mem, _num_cpu, _cpu_time = _domain_info
name = domain_name
return driver.InstanceInfo(name, state)
@ -539,8 +539,8 @@ class ProxyConnection(driver.ComputeDriver):
baremetal error is.
"""
(state, max_mem, mem, num_cpu, cpu_time) \
= self._conn.get_domain_info(instance_name)
_domain_info = self._conn.get_domain_info(instance_name)
state, max_mem, mem, num_cpu, cpu_time = _domain_info
return {'state': state,
'max_mem': max_mem,
'mem': mem,
@ -787,8 +787,8 @@ class HostState(object):
data["disk_used"] = connection.get_local_gb_used()
data["disk_available"] = data["disk_total"] - data["disk_used"]
data["host_memory_total"] = connection.get_memory_mb_total()
data["host_memory_free"] = data["host_memory_total"] - \
connection.get_memory_mb_used()
data["host_memory_free"] = (data["host_memory_total"] -
connection.get_memory_mb_used())
data["hypervisor_type"] = connection.get_hypervisor_type()
data["hypervisor_version"] = connection.get_hypervisor_version()
self._stats = data

View File

@ -202,8 +202,8 @@ class BareMetalNodes(object):
pdu_num = 2
pdu_outlet_num = node_id
path1 = "10.0.100." + str(pdu_num)
utils.execute('/tftpboot/pdu_mgr', path1, str(pdu_outlet_num), \
str(mode), '>>', 'pdu_output')
utils.execute('/tftpboot/pdu_mgr', path1, str(pdu_outlet_num),
str(mode), '>>', 'pdu_output')
def deactivate_node(self, node_id):
"""
@ -213,9 +213,9 @@ class BareMetalNodes(object):
and /tftpboot/root_x file is an file system image of node#x.
"""
node_ip = self.get_ip_by_id(node_id)
LOG.debug(_("deactivate_node is called for \
node_id = %(id)s node_ip = %(ip)s"),
{'id': str(node_id), 'ip': node_ip})
LOG.debug(_("deactivate_node is called for "
"node_id = %(id)s node_ip = %(ip)s"),
{'id': str(node_id), 'ip': node_ip})
for item in self.nodes:
if item['node_id'] == node_id:
LOG.debug(_("status of node is set to 0"))
@ -237,11 +237,11 @@ class BareMetalNodes(object):
User can access the bare-metal node using ssh.
"""
cmd = FLAGS.tile_monitor + \
" --resume --net " + node_ip + " --run - " + \
"ifconfig xgbe0 hw ether " + mac_address + \
" - --wait --run - ifconfig xgbe0 " + ip_address + \
" - --wait --quit"
cmd = (FLAGS.tile_monitor +
" --resume --net " + node_ip + " --run - " +
"ifconfig xgbe0 hw ether " + mac_address +
" - --wait --run - ifconfig xgbe0 " + ip_address +
" - --wait --quit")
subprocess.Popen(cmd, shell=True)
#utils.execute(cmd, shell=True)
self.sleep_mgr(5)
@ -263,8 +263,8 @@ class BareMetalNodes(object):
"""
LOG.debug(_("Before ping to the bare-metal node"))
tile_output = "/tftpboot/tile_output_" + str(node_id)
grep_cmd = "ping -c1 " + node_ip + " | grep Unreachable > " \
+ tile_output
grep_cmd = ("ping -c1 " + node_ip + " | grep Unreachable > " +
tile_output)
subprocess.Popen(grep_cmd, shell=True)
self.sleep_mgr(5)
@ -272,13 +272,13 @@ class BareMetalNodes(object):
out_msg = file.readline().find("Unreachable")
utils.execute('sudo', 'rm', tile_output)
if out_msg == -1:
cmd = "TILERA_BOARD_#" + str(node_id) + " " + node_ip \
+ " is ready"
cmd = ("TILERA_BOARD_#" + str(node_id) + " " + node_ip +
" is ready")
LOG.debug(_(cmd))
return True
else:
cmd = "TILERA_BOARD_#" + str(node_id) + " " \
+ node_ip + " is not ready, out_msg=" + out_msg
cmd = ("TILERA_BOARD_#" + str(node_id) + " " +
node_ip + " is not ready, out_msg=" + out_msg)
LOG.debug(_(cmd))
self.power_mgr(node_id, 2)
return False
@ -303,13 +303,13 @@ class BareMetalNodes(object):
"""
Sets and Runs sshd in the node.
"""
cmd = FLAGS.tile_monitor + \
" --resume --net " + node_ip + " --run - " + \
"/usr/sbin/sshd - --wait --quit"
cmd = (FLAGS.tile_monitor +
" --resume --net " + node_ip + " --run - " +
"/usr/sbin/sshd - --wait --quit")
subprocess.Popen(cmd, shell=True)
self.sleep_mgr(5)
def activate_node(self, node_id, node_ip, name, mac_address, \
def activate_node(self, node_id, node_ip, name, mac_address,
ip_address, user_data):
"""
Activates the given node using ID, IP, and MAC address.
@ -336,9 +336,9 @@ class BareMetalNodes(object):
"""
node_ip = self.get_ip_by_id(node_id)
log_path = "/tftpboot/log_" + str(node_id)
kmsg_cmd = FLAGS.tile_monitor + \
" --resume --net " + node_ip + \
" -- dmesg > " + log_path
kmsg_cmd = (FLAGS.tile_monitor +
" --resume --net " + node_ip +
" -- dmesg > " + log_path)
subprocess.Popen(kmsg_cmd, shell=True)
self.sleep_mgr(5)
utils.execute('cp', log_path, console_log)