Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap: fix imports for ipam models #642

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/641.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed incorrectly nested imports within if block used for Device Lifecycle Models.
178 changes: 89 additions & 89 deletions nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,148 +402,148 @@ def delete(self):
return self


if LIFECYCLE_MGMT:
class BootstrapNamespace(Namespace):
"""Bootstrap implementation of Bootstrap Namespace model."""

class BootstrapSoftware(Software):
"""Bootstrap implementation of Bootstrap Software model."""
@classmethod
def create(cls, diffsync, ids, attrs):
"""Create Namespace in Bootstrap from BootstrapNamespace object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create Software in Bootstrap from BootstrapSoftware object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)
def update(self, attrs):
"""Update Namespace in Bootstrap from BootstrapNamespace object."""
return super().update(attrs)

def update(self, attrs):
"""Update Software in Bootstrap from BootstrapSoftware object."""
return super().update(attrs)
def delete(self):
"""Delete Namespace in Bootstrap from BootstrapNamespace object."""
return self

def delete(self):
"""Delete Software in Bootstrap from BootstrapSoftware object."""
return self
class BootstrapRiR(RiR):
"""Bootstrap implementation of Bootstrap RiR model."""

class BootstrapSoftwareImage(SoftwareImage):
"""Bootstrap implementation of Bootstrap SoftwareImage model."""
@classmethod
def create(cls, diffsync, ids, attrs):
"""Create RiR in Bootstrap from BootstrapRiR object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create SoftwareImage in Bootstrap from BootstrapSoftwareImage object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)
def update(self, attrs):
"""Update RiR in Bootstrap from BootstrapRiR object."""
return super().update(attrs)

def update(self, attrs):
"""Update SoftwareImage in Bootstrap from BootstrapSoftwareImage object."""
return super().update(attrs)
def delete(self):
"""Delete RiR in Bootstrap from BootstrapRiR object."""
return self

def delete(self):
"""Delete SoftwareImage in Bootstrap from BootstrapSoftwareImage object."""
return self
class BootstrapVLANGroup(VLANGroup):
"""Bootstrap implementation of Bootstrap VLANGroup model."""

class BootstrapValidatedSoftware(ValidatedSoftware):
"""Bootstrap implementation of Bootstrap ValidatedSoftware model."""
@classmethod
def create(cls, diffsync, ids, attrs):
"""Create VLANGroup in Bootstrap from BootstrapVLANGroup object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)
def update(self, attrs):
"""Update VLANGroup in Bootstrap from BootstrapVLANGroup object."""
return super().update(attrs)

def update(self, attrs):
"""Update ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object."""
return super().update(attrs)
def delete(self):
"""Delete VLANGroup in Bootstrap from BootstrapVLANGroup object."""
return self

def delete(self):
"""Delete ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object."""
return self
class BootstrapVLAN(VLAN):
"""Bootstrap implementation of Bootstrap VLAN model."""

class BootstrapNamespace(Namespace):
"""Bootstrap implementation of Bootstrap Namespace model."""
@classmethod
def create(cls, diffsync, ids, attrs):
"""Create VLAN in Bootstrap from BootstrapVLAN object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create Namespace in Bootstrap from BootstrapNamespace object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)
def update(self, attrs):
"""Update VLAN in Bootstrap from BootstrapVLAN object."""
return super().update(attrs)

def update(self, attrs):
"""Update Namespace in Bootstrap from BootstrapNamespace object."""
return super().update(attrs)
def delete(self):
"""Delete VLAN in Bootstrap from BootstrapVLAN object."""
return self

def delete(self):
"""Delete Namespace in Bootstrap from BootstrapNamespace object."""
return self
class BootstrapVRF(VRF):
"""Bootstrap implementation of Bootstrap VRF model."""

class BootstrapRiR(RiR):
"""Bootstrap implementation of Bootstrap RiR model."""
@classmethod
def create(cls, diffsync, ids, attrs):
"""Create VRF in Bootstrap from BootstrapVRF object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create RiR in Bootstrap from BootstrapRiR object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)
def update(self, attrs):
"""Update VRF in Bootstrap from BootstrapVRF object."""
return super().update(attrs)

def update(self, attrs):
"""Update RiR in Bootstrap from BootstrapRiR object."""
return super().update(attrs)
def delete(self):
"""Delete VRF in Bootstrap from BootstrapVRF object."""
return self

def delete(self):
"""Delete RiR in Bootstrap from BootstrapRiR object."""
return self
class BootstrapPrefix(Prefix):
"""Bootstrap implementation of Bootstrap Prefix model."""

class BootstrapVLANGroup(VLANGroup):
"""Bootstrap implementation of Bootstrap VLANGroup model."""
@classmethod
def create(cls, diffsync, ids, attrs):
"""Create Prefix in Bootstrap from BootstrapPrefix object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create VLANGroup in Bootstrap from BootstrapVLANGroup object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)
def update(self, attrs):
"""Update Prefix in Bootstrap from BootstrapPrefix object."""
return super().update(attrs)

def update(self, attrs):
"""Update VLANGroup in Bootstrap from BootstrapVLANGroup object."""
return super().update(attrs)
def delete(self):
"""Delete Prefix in Bootstrap from BootstrapPrefix object."""
return self

def delete(self):
"""Delete VLANGroup in Bootstrap from BootstrapVLANGroup object."""
return self
if LIFECYCLE_MGMT:

class BootstrapVLAN(VLAN):
"""Bootstrap implementation of Bootstrap VLAN model."""
class BootstrapSoftware(Software):
"""Bootstrap implementation of Bootstrap Software model."""

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create VLAN in Bootstrap from BootstrapVLAN object."""
"""Create Software in Bootstrap from BootstrapSoftware object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update VLAN in Bootstrap from BootstrapVLAN object."""
"""Update Software in Bootstrap from BootstrapSoftware object."""
return super().update(attrs)

def delete(self):
"""Delete VLAN in Bootstrap from BootstrapVLAN object."""
"""Delete Software in Bootstrap from BootstrapSoftware object."""
return self

class BootstrapVRF(VRF):
"""Bootstrap implementation of Bootstrap VRF model."""
class BootstrapSoftwareImage(SoftwareImage):
"""Bootstrap implementation of Bootstrap SoftwareImage model."""

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create VRF in Bootstrap from BootstrapVRF object."""
"""Create SoftwareImage in Bootstrap from BootstrapSoftwareImage object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update VRF in Bootstrap from BootstrapVRF object."""
"""Update SoftwareImage in Bootstrap from BootstrapSoftwareImage object."""
return super().update(attrs)

def delete(self):
"""Delete VRF in Bootstrap from BootstrapVRF object."""
"""Delete SoftwareImage in Bootstrap from BootstrapSoftwareImage object."""
return self

class BootstrapPrefix(Prefix):
"""Bootstrap implementation of Bootstrap Prefix model."""
class BootstrapValidatedSoftware(ValidatedSoftware):
"""Bootstrap implementation of Bootstrap ValidatedSoftware model."""

@classmethod
def create(cls, diffsync, ids, attrs):
"""Create Prefix in Bootstrap from BootstrapPrefix object."""
"""Create ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object."""
return super().create(diffsync=diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update Prefix in Bootstrap from BootstrapPrefix object."""
"""Update ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object."""
return super().update(attrs)

def delete(self):
"""Delete Prefix in Bootstrap from BootstrapPrefix object."""
return self
"""Delete ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object."""
return self
Loading