diff --git a/api-daemon/pvcapid/ova.py b/api-daemon/pvcapid/ova.py index ce99292d..47fc63b2 100755 --- a/api-daemon/pvcapid/ova.py +++ b/api-daemon/pvcapid/ova.py @@ -529,7 +529,7 @@ class OVFParser(object): # Handle the unit conversion base_unit, action, multiple = disk_capacity_unit.split() multiple_base, multiple_exponent = multiple.split('^') - disk_capacity = int(disk_capacity) * (int(multiple_base) ** int(multiple_exponent) ) + disk_capacity = int(disk_capacity) * (int(multiple_base) ** int(multiple_exponent)) # Append the disk with all details to the list disk_list.append({ diff --git a/daemon-common/network.py b/daemon-common/network.py index 99373e75..3055de49 100644 --- a/daemon-common/network.py +++ b/daemon-common/network.py @@ -228,7 +228,7 @@ def add_network(zk_conn, vni, description, nettype, domain, name_servers, ip4_network, ip4_gateway, ip6_network, ip6_gateway, dhcp4_flag, dhcp4_start, dhcp4_end): # Ensure start and end DHCP ranges are set if the flag is set - if dhcp4_flag and (not dhcp4_start or not dhcp4_end ): + if dhcp4_flag and (not dhcp4_start or not dhcp4_end): return False, 'ERROR: DHCPv4 start and end addresses are required for a DHCPv4-enabled network.' # Check if a network with this VNI or description already exists diff --git a/node-daemon/pvcnoded/Daemon.py b/node-daemon/pvcnoded/Daemon.py index eae4fd01..b24cce5b 100644 --- a/node-daemon/pvcnoded/Daemon.py +++ b/node-daemon/pvcnoded/Daemon.py @@ -1627,7 +1627,7 @@ def node_keepalive(): # Handle deadtime and fencng if needed # (A node is considered dead when its keepalive timer is >6*keepalive_interval seconds # out-of-date while in 'start' state) - node_deadtime = int(time.time()) - (int(config['keepalive_interval']) * int(config['fence_intervals']) ) + node_deadtime = int(time.time()) - (int(config['keepalive_interval']) * int(config['fence_intervals'])) if node_keepalive < node_deadtime and node_daemon_state == 'run': logger.out('Node {} seems dead - starting monitor for fencing'.format(node_name), state='w') zk_lock = zkhandler.writelock(zk_conn, '/nodes/{}/daemonstate'.format(node_name)) diff --git a/node-daemon/pvcnoded/VXNetworkInstance.py b/node-daemon/pvcnoded/VXNetworkInstance.py index 85ba4472..470ec5a3 100644 --- a/node-daemon/pvcnoded/VXNetworkInstance.py +++ b/node-daemon/pvcnoded/VXNetworkInstance.py @@ -95,13 +95,13 @@ class VXNetworkInstance(object): self.ip6_gateway = zkhandler.readdata(self.zk_conn, '/networks/{}/ip6_gateway'.format(self.vni)) self.ip6_network = zkhandler.readdata(self.zk_conn, '/networks/{}/ip6_network'.format(self.vni)) self.ip6_cidrnetmask = zkhandler.readdata(self.zk_conn, '/networks/{}/ip6_network'.format(self.vni)).split('/')[-1] - self.dhcp6_flag = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp6_flag'.format(self.vni)) == 'True' ) + self.dhcp6_flag = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp6_flag'.format(self.vni)) == 'True') self.ip4_gateway = zkhandler.readdata(self.zk_conn, '/networks/{}/ip4_gateway'.format(self.vni)) self.ip4_network = zkhandler.readdata(self.zk_conn, '/networks/{}/ip4_network'.format(self.vni)) self.ip4_cidrnetmask = zkhandler.readdata(self.zk_conn, '/networks/{}/ip4_network'.format(self.vni)).split('/')[-1] - self.dhcp4_flag = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp4_flag'.format(self.vni)) == 'True' ) - self.dhcp4_start = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp4_start'.format(self.vni)) == 'True' ) - self.dhcp4_end = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp4_end'.format(self.vni)) == 'True' ) + self.dhcp4_flag = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp4_flag'.format(self.vni)) == 'True') + self.dhcp4_start = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp4_start'.format(self.vni)) == 'True') + self.dhcp4_end = (zkhandler.readdata(self.zk_conn, '/networks/{}/dhcp4_end'.format(self.vni)) == 'True') self.vxlan_nic = 'vxlan{}'.format(self.vni) self.bridge_nic = 'vmbr{}'.format(self.vni) @@ -254,8 +254,8 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out # because this class instance is about to be reaped in Daemon.py return False - if data and self.dhcp6_flag != (data.decode('ascii') == 'True' ): - self.dhcp6_flag = (data.decode('ascii') == 'True' ) + if data and self.dhcp6_flag != (data.decode('ascii') == 'True'): + self.dhcp6_flag = (data.decode('ascii') == 'True') if self.dhcp6_flag and not self.dhcp_server_daemon and self.this_node.router_state in ['primary', 'takeover']: self.startDHCPServer() elif self.dhcp_server_daemon and not self.dhcp4_flag and self.this_node.router_state in ['primary', 'takeover']: @@ -305,8 +305,8 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out # because this class instance is about to be reaped in Daemon.py return False - if data and self.dhcp4_flag != (data.decode('ascii') == 'True' ): - self.dhcp4_flag = (data.decode('ascii') == 'True' ) + if data and self.dhcp4_flag != (data.decode('ascii') == 'True'): + self.dhcp4_flag = (data.decode('ascii') == 'True') if self.dhcp4_flag and not self.dhcp_server_daemon and self.this_node.router_state in ['primary', 'takeover']: self.startDHCPServer() elif self.dhcp_server_daemon and not self.dhcp6_flag and self.this_node.router_state in ['primary', 'takeover']: