black formating in create-sc-instance

This commit is contained in:
Patrik Holmqvist 2025-02-18 10:20:23 +01:00
parent c3e5ff46af
commit a00eb2a63f
Signed by: pahol
GPG key ID: 5D5B0D4E93F77273

View file

@ -77,9 +77,7 @@ def get_port( # pylint:disable=too-many-arguments,too-many-branches
return port return port
print(f"creating port: {port_name}") print(f"creating port: {port_name}")
port = conn.network.create_port( port = conn.network.create_port(network_id=network.id, name=port_name)
network_id=network.id, name=port_name
)
if not isinstance(port, Port): if not isinstance(port, Port):
raise TypeError(f"port should be {Port} but is {type(port)}") raise TypeError(f"port should be {Port} but is {type(port)}")
@ -113,15 +111,15 @@ def create_server( # pylint: disable=too-many-arguments, too-many-locals
f"flavor '{flavor.name}' includes no disk, using block storage for all disks" f"flavor '{flavor.name}' includes no disk, using block storage for all disks"
) )
volume_type_name = "fast" volume_type_name = "fast"
#volume_type = conn.volume.find_type(volume_type_name) # volume_type = conn.volume.find_type(volume_type_name)
#if volume_type is None: # if volume_type is None:
#raise RuntimeError(f"unable to find volume type '{volume_type_name}'") # raise RuntimeError(f"unable to find volume type '{volume_type_name}'")
for i, size in enumerate(disk_sizes): for i, size in enumerate(disk_sizes):
block_mapping = { block_mapping = {
"delete_on_termination": True, "delete_on_termination": True,
"destination_type": "volume", "destination_type": "volume",
"volume_size": size, "volume_size": size,
#"volume_type": volume_type.name, # "volume_type": volume_type.name,
} }
# The first disk is the OS disk, base it on the selected image and bootable # The first disk is the OS disk, base it on the selected image and bootable
if i == 0: if i == 0:
@ -161,6 +159,7 @@ def create_server( # pylint: disable=too-many-arguments, too-many-locals
return server return server
def main() -> ( def main() -> (
None None
): # pylint: disable=too-many-locals,too-many-statements,too-many-branches ): # pylint: disable=too-many-locals,too-many-statements,too-many-branches
@ -199,7 +198,7 @@ def main() -> (
) )
parser.add_argument( parser.add_argument(
"--network-name", "--network-name",
help="provide disk size in GB", help="The network name in safespring, ex 'public'",
required=True, required=True,
) )
parser.add_argument( parser.add_argument(