Skip to content

Commit 0b10131

Browse files
committed
Satisfy PEP8 E721 linter complaints
1 parent 006c353 commit 0b10131

File tree

5 files changed

+51
-51
lines changed

5 files changed

+51
-51
lines changed

netbox/dcim/graphql/gfk_mixins.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,23 @@ class Meta:
5353

5454
@classmethod
5555
def resolve_type(cls, instance, info):
56-
if type(instance) == CircuitTermination:
56+
if type(instance) is CircuitTermination:
5757
return CircuitTerminationType
58-
if type(instance) == ConsolePortType:
58+
if type(instance) is ConsolePortType:
5959
return ConsolePortType
60-
if type(instance) == ConsoleServerPort:
60+
if type(instance) is ConsoleServerPort:
6161
return ConsoleServerPortType
62-
if type(instance) == FrontPort:
62+
if type(instance) is FrontPort:
6363
return FrontPortType
64-
if type(instance) == Interface:
64+
if type(instance) is Interface:
6565
return InterfaceType
66-
if type(instance) == PowerFeed:
66+
if type(instance) is PowerFeed:
6767
return PowerFeedType
68-
if type(instance) == PowerOutlet:
68+
if type(instance) is PowerOutlet:
6969
return PowerOutletType
70-
if type(instance) == PowerPort:
70+
if type(instance) is PowerPort:
7171
return PowerPortType
72-
if type(instance) == RearPort:
72+
if type(instance) is RearPort:
7373
return RearPortType
7474

7575

@@ -89,23 +89,23 @@ class Meta:
8989

9090
@classmethod
9191
def resolve_type(cls, instance, info):
92-
if type(instance) == CircuitTermination:
92+
if type(instance) is CircuitTermination:
9393
return CircuitTerminationType
94-
if type(instance) == ConsolePortType:
94+
if type(instance) is ConsolePortType:
9595
return ConsolePortType
96-
if type(instance) == ConsoleServerPort:
96+
if type(instance) is ConsoleServerPort:
9797
return ConsoleServerPortType
98-
if type(instance) == FrontPort:
98+
if type(instance) is FrontPort:
9999
return FrontPortType
100-
if type(instance) == Interface:
100+
if type(instance) is Interface:
101101
return InterfaceType
102-
if type(instance) == PowerFeed:
102+
if type(instance) is PowerFeed:
103103
return PowerFeedType
104-
if type(instance) == PowerOutlet:
104+
if type(instance) is PowerOutlet:
105105
return PowerOutletType
106-
if type(instance) == PowerPort:
106+
if type(instance) is PowerPort:
107107
return PowerPortType
108-
if type(instance) == RearPort:
108+
if type(instance) is RearPort:
109109
return RearPortType
110110

111111

@@ -123,19 +123,19 @@ class Meta:
123123

124124
@classmethod
125125
def resolve_type(cls, instance, info):
126-
if type(instance) == ConsolePortTemplate:
126+
if type(instance) is ConsolePortTemplate:
127127
return ConsolePortTemplateType
128-
if type(instance) == ConsoleServerPortTemplate:
128+
if type(instance) is ConsoleServerPortTemplate:
129129
return ConsoleServerPortTemplateType
130-
if type(instance) == FrontPortTemplate:
130+
if type(instance) is FrontPortTemplate:
131131
return FrontPortTemplateType
132-
if type(instance) == InterfaceTemplate:
132+
if type(instance) is InterfaceTemplate:
133133
return InterfaceTemplateType
134-
if type(instance) == PowerOutletTemplate:
134+
if type(instance) is PowerOutletTemplate:
135135
return PowerOutletTemplateType
136-
if type(instance) == PowerPortTemplate:
136+
if type(instance) is PowerPortTemplate:
137137
return PowerPortTemplateType
138-
if type(instance) == RearPortTemplate:
138+
if type(instance) is RearPortTemplate:
139139
return RearPortTemplateType
140140

141141

@@ -153,17 +153,17 @@ class Meta:
153153

154154
@classmethod
155155
def resolve_type(cls, instance, info):
156-
if type(instance) == ConsolePort:
156+
if type(instance) is ConsolePort:
157157
return ConsolePortType
158-
if type(instance) == ConsoleServerPort:
158+
if type(instance) is ConsoleServerPort:
159159
return ConsoleServerPortType
160-
if type(instance) == FrontPort:
160+
if type(instance) is FrontPort:
161161
return FrontPortType
162-
if type(instance) == Interface:
162+
if type(instance) is Interface:
163163
return InterfaceType
164-
if type(instance) == PowerOutlet:
164+
if type(instance) is PowerOutlet:
165165
return PowerOutletType
166-
if type(instance) == PowerPort:
166+
if type(instance) is PowerPort:
167167
return PowerPortType
168-
if type(instance) == RearPort:
168+
if type(instance) is RearPort:
169169
return RearPortType

netbox/ipam/graphql/gfk_mixins.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ class Meta:
2424

2525
@classmethod
2626
def resolve_type(cls, instance, info):
27-
if type(instance) == Interface:
27+
if type(instance) is Interface:
2828
return InterfaceType
29-
if type(instance) == FHRPGroup:
29+
if type(instance) is FHRPGroup:
3030
return FHRPGroupType
31-
if type(instance) == VMInterface:
31+
if type(instance) is VMInterface:
3232
return VMInterfaceType
3333

3434

@@ -42,11 +42,11 @@ class Meta:
4242

4343
@classmethod
4444
def resolve_type(cls, instance, info):
45-
if type(instance) == Interface:
45+
if type(instance) is Interface:
4646
return InterfaceType
47-
if type(instance) == VLAN:
47+
if type(instance) is VLAN:
4848
return VLANType
49-
if type(instance) == VMInterface:
49+
if type(instance) is VMInterface:
5050
return VMInterfaceType
5151

5252

@@ -59,9 +59,9 @@ class Meta:
5959

6060
@classmethod
6161
def resolve_type(cls, instance, info):
62-
if type(instance) == Interface:
62+
if type(instance) is Interface:
6363
return InterfaceType
64-
if type(instance) == VMInterface:
64+
if type(instance) is VMInterface:
6565
return VMInterfaceType
6666

6767

@@ -79,17 +79,17 @@ class Meta:
7979

8080
@classmethod
8181
def resolve_type(cls, instance, info):
82-
if type(instance) == Cluster:
82+
if type(instance) is Cluster:
8383
return ClusterType
84-
if type(instance) == ClusterGroup:
84+
if type(instance) is ClusterGroup:
8585
return ClusterGroupType
86-
if type(instance) == Location:
86+
if type(instance) is Location:
8787
return LocationType
88-
if type(instance) == Rack:
88+
if type(instance) is Rack:
8989
return RackType
90-
if type(instance) == Region:
90+
if type(instance) is Region:
9191
return RegionType
92-
if type(instance) == Site:
92+
if type(instance) is Site:
9393
return SiteType
94-
if type(instance) == SiteGroup:
94+
if type(instance) is SiteGroup:
9595
return SiteGroupType

netbox/ipam/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def add_available_vlans(vlans, vlan_group=None):
121121
})
122122

123123
vlans = list(vlans) + new_vlans
124-
vlans.sort(key=lambda v: v.vid if type(v) == VLAN else v['vid'])
124+
vlans.sort(key=lambda v: v.vid if type(v) is VLAN else v['vid'])
125125

126126
return vlans
127127

netbox/utilities/forms/bulk_import.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ def _clean_yaml(self, data):
123123
records = []
124124
try:
125125
for data in yaml.load_all(data, Loader=yaml.SafeLoader):
126-
if type(data) == list:
126+
if type(data) is list:
127127
records.extend(data)
128-
elif type(data) == dict:
128+
elif type(data) is dict:
129129
records.append(data)
130130
else:
131131
raise forms.ValidationError({

netbox/utilities/templatetags/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def annotated_date(date_value):
114114
if not date_value:
115115
return ''
116116

117-
if type(date_value) == datetime.date:
117+
if type(date_value) is datetime.date:
118118
long_ts = date(date_value, 'DATE_FORMAT')
119119
short_ts = date(date_value, 'SHORT_DATE_FORMAT')
120120
else:

0 commit comments

Comments
 (0)