summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorZhongyue Luo <lzyeval@gmail.com>2012-02-10 02:44:22 -0500
committerZhongyue Luo <lzyeval@gmail.com>2012-02-10 02:56:45 -0500
commit8dabc7baeecb0aebd65f89d7c6bda0ea97f1ca28 (patch)
tree8ae30b978c4caa4d726a6e6bded68b38d50f7abd /nova
parent5ad971810aaedcf5c9efd1b56add0e23921899ae (diff)
downloadnova-8dabc7baeecb0aebd65f89d7c6bda0ea97f1ca28.tar.gz
nova-8dabc7baeecb0aebd65f89d7c6bda0ea97f1ca28.tar.xz
nova-8dabc7baeecb0aebd65f89d7c6bda0ea97f1ca28.zip
Backslash continuations (nova.virt.baremetal)
Fixes bug #929998 Backslash continuations removal for package nova.virt.baremetal Change-Id: I74beb27b5f5f13fbd6a391a2dc8acf2834846066
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/baremetal/fake.py2
-rw-r--r--nova/virt/baremetal/proxy.py12
-rw-r--r--nova/virt/baremetal/tilera.py46
3 files changed, 30 insertions, 30 deletions
diff --git a/nova/virt/baremetal/fake.py b/nova/virt/baremetal/fake.py
index c849104b3..635089366 100644
--- a/nova/virt/baremetal/fake.py
+++ b/nova/virt/baremetal/fake.py
@@ -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.
diff --git a/nova/virt/baremetal/proxy.py b/nova/virt/baremetal/proxy.py
index 78b5de7df..bd015bf7f 100644
--- a/nova/virt/baremetal/proxy.py
+++ b/nova/virt/baremetal/proxy.py
@@ -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)
@@ -544,8 +544,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,
@@ -792,8 +792,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
diff --git a/nova/virt/baremetal/tilera.py b/nova/virt/baremetal/tilera.py
index 7e31a1553..04bcfff6f 100644
--- a/nova/virt/baremetal/tilera.py
+++ b/nova/virt/baremetal/tilera.py
@@ -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)