self.sysfs.link_set_mtu(ifaceobj.name, mtu_str=str(lower_iface_mtu_int), mtu_int=lower_iface_mtu_int)
elif (
- not (ifaceobj.name == 'lo')
+ ifaceobj.name != 'lo'
and not ifaceobj.link_kind
and not (ifaceobj.link_privflags & ifaceLinkPrivFlags.BOND_SLAVE)
and self.default_mtu
]:
for macvlan_ifacename in glob.glob("/sys/class/net/%s*" % macvlan_prefix):
macvlan_ifacename = os.path.basename(macvlan_ifacename)
- if not self.cache.link_exists(macvlan_ifacename) or not self.cache.get_link_kind(macvlan_ifacename) == "macvlan":
+ if not self.cache.link_exists(macvlan_ifacename) or self.cache.get_link_kind(macvlan_ifacename) != "macvlan":
continue
hwaddress.append(self.cache.get_link_address(macvlan_ifacename))
self.netlink.link_del(os.path.basename(macvlan_ifacename))
dhclient_cmd_prefix = None
dhcp_wait = policymanager.policymanager_api.get_attr_default(
module_name=self.__class__.__name__, attr='dhcp-wait')
- wait = not str(dhcp_wait).lower() == "no"
+ wait = str(dhcp_wait).lower() != "no"
dhcp6_ll_wait = policymanager.policymanager_api.get_iface_default(module_name=self.__class__.__name__, \
ifname=ifaceobj.name, attr='dhcp6-ll-wait')
try:
if not self.cache.link_exists(ifname):
return
- if not self.cache.get_link_kind(ifname) == 'vlan':
+ if self.cache.get_link_kind(ifname) != 'vlan':
return
# If vlan name is not in the dot format, get the
if not self.cache.link_exists(ifname):
return
- if not self.cache.get_link_kind(ifname) == 'vxlan':
+ if self.cache.get_link_kind(ifname) != 'vxlan':
return
cached_vxlan_ifla_info_data = self.cache.get_link_info_data(ifname)
'-'.join(validrange)))
if multiple is not None:
- if not (n % multiple == 0):
+ if n % multiple != 0:
raise invalidValueError('invalid value %s: must be a multiple of %s' % (n, multiple))
return True
'-'.join(validrange)))
if multiple is not None:
- if not (number % multiple == 0):
+ if number % multiple != 0:
raise invalidValueError('invalid value %s: must be a multiple of %s' % (number, multiple))
return True
if hasattr(self.args, 'interfacesfile') and self.args.interfacesfile != None:
# Check to see if -i option is allowed by config file
# But for ifquery, we will not check this
- if (not self.op == 'query' and
+ if (self.op != 'query' and
configmap_g.get('disable_cli_interfacesfile', '0') == '1'):
log.error('disable_cli_interfacesfile is set so users '
'not allowed to specify interfaces file on cli.')