Skip to content

Commit 5434016

Browse files
committed
ran black . -l 79
1 parent 1778d7d commit 5434016

3 files changed

Lines changed: 116 additions & 91 deletions

File tree

ns1/__init__.py

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def loadZone(self, zone, callback=None, errback=None):
248248
return zone.load(callback=callback, errback=errback)
249249

250250
def searchZone(
251-
self, zone, q=None, has_geo=False, callback=None, errback=None
251+
self, zone, q=None, has_geo=False, callback=None, errback=None
252252
):
253253
"""
254254
Search a zone for a given search query (e.g., for geological data, etc)
@@ -260,7 +260,7 @@ def searchZone(
260260
return zone.search(q, has_geo, callback=callback, errback=errback)
261261

262262
def createZone(
263-
self, zone, zoneFile=None, callback=None, errback=None, **kwargs
263+
self, zone, zoneFile=None, callback=None, errback=None, **kwargs
264264
):
265265
"""
266266
Create a new zone, and return an associated high level Zone object.
@@ -288,7 +288,7 @@ def createZone(
288288
)
289289

290290
def loadRecord(
291-
self, domain, type, zone=None, callback=None, errback=None, **kwargs
291+
self, domain, type, zone=None, callback=None, errback=None, **kwargs
292292
):
293293
"""
294294
Load an existing record into a high level Record object.
@@ -365,7 +365,7 @@ def loadNetworkbyName(self, name, callback=None, errback=None):
365365
return network.load(callback=callback, errback=errback)
366366

367367
def createNetwork(
368-
self, name, scope_group_id=None, callback=None, errback=None, **kwargs
368+
self, name, scope_group_id=None, callback=None, errback=None, **kwargs
369369
):
370370
"""
371371
Create a new Network
@@ -398,7 +398,7 @@ def loadAddressbyID(self, id, callback=None, errback=None):
398398
return address.load(callback=callback, errback=errback)
399399

400400
def loadAddressbyPrefix(
401-
self, prefix, status, network_id, callback=None, errback=None
401+
self, prefix, status, network_id, callback=None, errback=None
402402
):
403403
"""
404404
Load an existing address by prefix, status and network into a high level Address object
@@ -417,7 +417,7 @@ def loadAddressbyPrefix(
417417
return address.load(callback=callback, errback=errback)
418418

419419
def createAddress(
420-
self, prefix, status, network_id, callback=None, errback=None, **kwargs
420+
self, prefix, status, network_id, callback=None, errback=None, **kwargs
421421
):
422422
"""
423423
Create a new Address
@@ -449,7 +449,14 @@ def loadScopeGroup(self, id, callback=None, errback=None):
449449
return scope_group.load(callback=callback, errback=errback)
450450

451451
def createScopeGroup(
452-
self, name, service_def_id, dhcp4, dhcp6, callback=None, errback=None, **kwargs
452+
self,
453+
name,
454+
service_def_id,
455+
dhcp4,
456+
dhcp6,
457+
callback=None,
458+
errback=None,
459+
**kwargs
453460
):
454461
"""
455462
Create a new Scope Group
@@ -467,18 +474,22 @@ def createScopeGroup(
467474
)
468475

469476
return scope_group.create(
470-
dhcp4=dhcp4, dhcp6=dhcp6, callback=callback, errback=errback, **kwargs
477+
dhcp4=dhcp4,
478+
dhcp6=dhcp6,
479+
callback=callback,
480+
errback=errback,
481+
**kwargs
471482
)
472483

473484
def createReservation(
474-
self,
475-
scopegroup_id,
476-
address_id,
477-
mac,
478-
dhcp_options=None,
479-
callback=None,
480-
errback=None,
481-
**kwargs
485+
self,
486+
scopegroup_id,
487+
address_id,
488+
mac,
489+
dhcp_options=None,
490+
callback=None,
491+
errback=None,
492+
**kwargs
482493
):
483494
"""
484495
Create a new Reservation
@@ -498,7 +509,7 @@ def createReservation(
498509
return reservation.create(callback=callback, errback=errback, **kwargs)
499510

500511
def loadReservation(
501-
self, scopegroup_id, address_id, callback=None, errback=None
512+
self, scopegroup_id, address_id, callback=None, errback=None
502513
):
503514
import ns1.ipam
504515

@@ -509,13 +520,13 @@ def loadReservation(
509520
return reservation.load(callback=callback, errback=errback)
510521

511522
def createScope(
512-
self,
513-
scopegroup_id,
514-
address_id,
515-
dhcp_options=None,
516-
callback=None,
517-
errback=None,
518-
**kwargs
523+
self,
524+
scopegroup_id,
525+
address_id,
526+
dhcp_options=None,
527+
callback=None,
528+
errback=None,
529+
**kwargs
519530
):
520531
"""
521532
Create a new Scope
@@ -534,7 +545,7 @@ def createScope(
534545
return scope.create(callback=callback, errback=errback, **kwargs)
535546

536547
def loadScope(
537-
self, scopegroup_id, address_id, callback=None, errback=None
548+
self, scopegroup_id, address_id, callback=None, errback=None
538549
):
539550
import ns1.ipam
540551

@@ -543,13 +554,13 @@ def loadScope(
543554
return scope.load(callback=callback, errback=errback)
544555

545556
def loadLeases(
546-
self,
547-
scope_group_id=None,
548-
scope_id=None,
549-
limit=None,
550-
offset=None,
551-
callback=None,
552-
errback=None,
557+
self,
558+
scope_group_id=None,
559+
scope_id=None,
560+
limit=None,
561+
offset=None,
562+
callback=None,
563+
errback=None,
553564
):
554565
import ns1.ipam
555566

ns1/ipam.py

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def success(result, *args):
166166
)
167167

168168
def new_address(
169-
self, prefix, status, callback=None, errback=None, **kwargs
169+
self, prefix, status, callback=None, errback=None, **kwargs
170170
):
171171
"""
172172
Create a new address space in this Network
@@ -184,14 +184,14 @@ def new_address(
184184

185185
class Address(object):
186186
def __init__(
187-
self,
188-
config,
189-
prefix=None,
190-
status=None,
191-
network=None,
192-
scope_group=None,
193-
id=None,
194-
tags=None
187+
self,
188+
config,
189+
prefix=None,
190+
status=None,
191+
network=None,
192+
scope_group=None,
193+
id=None,
194+
tags=None,
195195
):
196196
"""
197197
Create a new high level Address object
@@ -267,9 +267,9 @@ def success(result, *args):
267267

268268
if self.id is None:
269269
if (
270-
self.prefix is None
271-
or self.status is None
272-
or self.network is None
270+
self.prefix is None
271+
or self.status is None
272+
or self.network is None
273273
):
274274
raise AddressException(
275275
"Must at least specify an id or prefix, status, and network"
@@ -338,7 +338,7 @@ def success(result, *args):
338338
)
339339

340340
def reserve(
341-
self, scopegroup_id, mac, options=None, callback=None, errback=None
341+
self, scopegroup_id, mac, options=None, callback=None, errback=None
342342
):
343343
"""
344344
Add scope group reservation. Pass a single Address object and a MAC address as a string
@@ -402,7 +402,9 @@ def success(result, *args):
402402

403403

404404
class Scopegroup(object):
405-
def __init__(self, config, name=None, service_def_id=None, id=None, tags=None):
405+
def __init__(
406+
self, config, name=None, service_def_id=None, id=None, tags=None
407+
):
406408
"""
407409
Create a new high level Scopegroup object
408410
@@ -539,7 +541,7 @@ def success(result, *args):
539541
)
540542

541543
def reserve(
542-
self, address_id, mac, options=None, callback=None, errback=None
544+
self, address_id, mac, options=None, callback=None, errback=None
543545
):
544546
"""
545547
:param int address_id: id of the Address to reserve
@@ -593,14 +595,14 @@ def scopes(self, callback=None, errback=None):
593595

594596
class Reservation(object):
595597
def __init__(
596-
self,
597-
config,
598-
scopegroup_id,
599-
address_id,
600-
reservation_id=None,
601-
options=None,
602-
mac=None,
603-
tags=None
598+
self,
599+
config,
600+
scopegroup_id,
601+
address_id,
602+
reservation_id=None,
603+
options=None,
604+
mac=None,
605+
tags=None,
604606
):
605607
"""
606608
Create a new high level Reservation object
@@ -715,7 +717,7 @@ def success(result, *args):
715717
)
716718

717719
def update(
718-
self, options, callback=None, errback=None, parent=True, **kwargs
720+
self, options, callback=None, errback=None, parent=True, **kwargs
719721
):
720722
"""
721723
Update reservation configuration. Pass a list of keywords and their values to
@@ -842,7 +844,13 @@ def success(result, *args):
842844

843845
class Scope(object):
844846
def __init__(
845-
self, config, scopegroup_id, address_id, scope_id=None, options=None, tags=None
847+
self,
848+
config,
849+
scopegroup_id,
850+
address_id,
851+
scope_id=None,
852+
options=None,
853+
tags=None,
846854
):
847855
"""
848856
Create a new high level Scope object
@@ -952,7 +960,7 @@ def success(result, *args):
952960
)
953961

954962
def update(
955-
self, address_id, options, callback=None, errback=None, **kwargs
963+
self, address_id, options, callback=None, errback=None, **kwargs
956964
):
957965
"""
958966
Update Scope configuration. Pass a list of keywords and their values to
@@ -1006,14 +1014,14 @@ def reload(self, callback=None, errback=None):
10061014
return self.load(reload=True, callback=callback, errback=errback)
10071015

10081016
def load(
1009-
self,
1010-
scope_group_id=None,
1011-
scope_id=None,
1012-
limit=None,
1013-
offset=None,
1014-
callback=None,
1015-
errback=None,
1016-
reload=False,
1017+
self,
1018+
scope_group_id=None,
1019+
scope_id=None,
1020+
limit=None,
1021+
offset=None,
1022+
callback=None,
1023+
errback=None,
1024+
reload=False,
10171025
):
10181026
"""
10191027
Load Lease data from the API.

0 commit comments

Comments
 (0)