1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Satisfy PEP8 E721 linter complaints

This commit is contained in:
Jeremy Stretch
2023-07-30 13:34:08 -04:00
parent 006c353d46
commit 0b10131564
5 changed files with 51 additions and 51 deletions

View File

@@ -24,11 +24,11 @@ class IPAddressAssignmentType(graphene.Union):
@classmethod
def resolve_type(cls, instance, info):
if type(instance) == Interface:
if type(instance) is Interface:
return InterfaceType
if type(instance) == FHRPGroup:
if type(instance) is FHRPGroup:
return FHRPGroupType
if type(instance) == VMInterface:
if type(instance) is VMInterface:
return VMInterfaceType
@@ -42,11 +42,11 @@ class L2VPNAssignmentType(graphene.Union):
@classmethod
def resolve_type(cls, instance, info):
if type(instance) == Interface:
if type(instance) is Interface:
return InterfaceType
if type(instance) == VLAN:
if type(instance) is VLAN:
return VLANType
if type(instance) == VMInterface:
if type(instance) is VMInterface:
return VMInterfaceType
@@ -59,9 +59,9 @@ class FHRPGroupInterfaceType(graphene.Union):
@classmethod
def resolve_type(cls, instance, info):
if type(instance) == Interface:
if type(instance) is Interface:
return InterfaceType
if type(instance) == VMInterface:
if type(instance) is VMInterface:
return VMInterfaceType
@@ -79,17 +79,17 @@ class VLANGroupScopeType(graphene.Union):
@classmethod
def resolve_type(cls, instance, info):
if type(instance) == Cluster:
if type(instance) is Cluster:
return ClusterType
if type(instance) == ClusterGroup:
if type(instance) is ClusterGroup:
return ClusterGroupType
if type(instance) == Location:
if type(instance) is Location:
return LocationType
if type(instance) == Rack:
if type(instance) is Rack:
return RackType
if type(instance) == Region:
if type(instance) is Region:
return RegionType
if type(instance) == Site:
if type(instance) is Site:
return SiteType
if type(instance) == SiteGroup:
if type(instance) is SiteGroup:
return SiteGroupType

View File

@@ -121,7 +121,7 @@ def add_available_vlans(vlans, vlan_group=None):
})
vlans = list(vlans) + new_vlans
vlans.sort(key=lambda v: v.vid if type(v) == VLAN else v['vid'])
vlans.sort(key=lambda v: v.vid if type(v) is VLAN else v['vid'])
return vlans