Skip to content

Fixed SyntaxError: f-string: unmatched '[' #48

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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
10 changes: 5 additions & 5 deletions nbs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def sync_docker(self, dockerConf: dict[str, str], dockerDef: configparser.Sectio
logging.error(f'No devices matched name {deviceName}')
device = next(devices)
site = device.site
clusterName = f'Docker {device['name']}'
clusterName = f'Docker {device["name"]}'
cluster = self.netbox.virtualization.clusters.get(name=clusterName)
if cluster is None:
logging.info(f'No Cluster exists for device {deviceName}, creating...')
Expand Down Expand Up @@ -275,7 +275,7 @@ def sync_docker(self, dockerConf: dict[str, str], dockerDef: configparser.Sectio
serviceDescription = container.labels['org.opencontainers.image.title']
if 'org.opencontainers.image.description' in container.labels:
if serviceDescription is not None:
serviceDescription = f'{serviceDescription} - {container.labels['org.opencontainers.image.description']}'
serviceDescription = f'{serviceDescription} - {container.labels["org.opencontainers.image.description"]}'
else:
serviceDescription = container.labels['org.opencontainers.image.description']

Expand Down Expand Up @@ -347,10 +347,10 @@ def docker_upsert_network(self,device: pynetbox.models.dcim.Devices, d_network:
'external': None
}

vrf = self.netbox.ipam.vrfs.get(name=f'Docker on {device['name']}')
vrf = self.netbox.ipam.vrfs.get(name=f'Docker on {device["name"]}')
if vrf is None:
vrf = self.netbox.ipam.vrfs.create(name=f'Docker on {device['name']}', rd=f'docker-{device['name']}')
logging.info(f'Created missing VRF for docker on {device['name']} with ID {vrf.id}')
vrf = self.netbox.ipam.vrfs.create(name=f'Docker on {device["name"]}', rd=f'docker-{device["name"]}')
logging.info(f'Created missing VRF for docker on {device["name"]} with ID {vrf.id}')

range = self.netbox.ipam.ip_ranges.get(description=networkName,vrf_id=vrf.id)
if range is None:
Expand Down