Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/stack/build/build_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_containers_in_scope(stack):
else:
containers_in_scope.append(StackContainer(container["name"], ref=container.get("ref"), path=container.get("path")))

log_debug(f'Containers: {containers_in_scope}')
log_debug(f"Containers: {containers_in_scope}")
if stack:
log_debug(f"Stack: {stack}")

Expand Down
6 changes: 3 additions & 3 deletions src/stack/build/build_webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@


@click.command()
@click.option('--base-container')
@click.option('--source-repo', help="directory containing the webapp to build", required=True)
@click.option("--base-container")
@click.option("--source-repo", help="directory containing the webapp to build", required=True)
@click.option("--force-rebuild", is_flag=True, default=False, help="Override dependency checking -- always rebuild")
@click.option("--extra-build-args", help="Supply extra arguments to build")
@click.option("--tag", help="Container tag (default: bozemanpass/<app_name>:stack)")
Expand All @@ -52,7 +52,7 @@ def command(ctx, base_container, source_repo, force_rebuild, extra_build_args, t

dev_root_path = get_dev_root_path()

log_debug(f'Dev Root is: {dev_root_path}')
log_debug(f"Dev Root is: {dev_root_path}")

if not base_container:
base_container = determine_base_container(source_repo)
Expand Down
10 changes: 5 additions & 5 deletions src/stack/deploy/k8s/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def named_volumes_from_pod_files(parsed_pod_files):
volumes = parsed_pod_file["volumes"]
for volume, value in volumes.items():
# Volume definition looks like:
# 'laconicd-data': None
# "laconicd-data": None
named_volumes.append(volume)
return named_volumes

Expand Down Expand Up @@ -252,7 +252,7 @@ def _generate_kind_mounts(parsed_pod_files, deployment_dir, deployment_context):
f" - hostPath: {_make_absolute_host_path(volume_host_path_map[volume_name], deployment_dir)}\n"
f" containerPath: {get_kind_pv_bind_mount_path(volume_name)}\n"
)
return "" if len(volume_definitions) == 0 else (" extraMounts:\n" f"{''.join(volume_definitions)}")
return "" if len(volume_definitions) == 0 else (" extraMounts:\n" f"{"".join(volume_definitions)}")


# TODO: decide if we need this functionality
Expand All @@ -270,15 +270,15 @@ def _generate_kind_port_mappings_from_services(parsed_pod_files):
# TODO handle the complex cases
# Looks like: 80 or something more complicated
port_definitions.append(f" - containerPort: {port_string}\n hostPort: {port_string}\n")
return "" if len(port_definitions) == 0 else (" extraPortMappings:\n" f"{''.join(port_definitions)}")
return "" if len(port_definitions) == 0 else (" extraPortMappings:\n" f"{"".join(port_definitions)}")


def _generate_kind_port_mappings(parsed_pod_files):
port_definitions = []
# For now we just map port 80 for the nginx ingress controller we install in kind
port_string = "80"
port_definitions.append(f" - containerPort: {port_string}\n hostPort: {port_string}\n")
return "" if len(port_definitions) == 0 else (" extraPortMappings:\n" f"{''.join(port_definitions)}")
return "" if len(port_definitions) == 0 else (" extraPortMappings:\n" f"{"".join(port_definitions)}")


# Note: this makes any duplicate definition in b overwrite a
Expand Down Expand Up @@ -330,7 +330,7 @@ def envs_from_environment_variables_map(map: Mapping[str, str]) -> List[client.V


def env_var_name_for_service(svc):
return f"STACK_SVC_{svc.metadata.labels['service'].upper()}".replace("-", "_")
return f"STACK_SVC_{svc.metadata.labels["service"].upper()}".replace("-", "_")


# This needs to know:
Expand Down
2 changes: 1 addition & 1 deletion src/stack/deploy/webapp/run_webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ def command(ctx, image, config_file, port):
# TODO: This assumes a Docker container object...
if webappPort in container.network_settings.ports:
mapping = container.network_settings.ports[webappPort][0]
output_main(f"""Image: {image}\nID: {container.id}\nURL: http://localhost:{mapping['HostPort']}""")
output_main(f"""Image: {image}\nID: {container.id}\nURL: http://localhost:{mapping["HostPort"]}""")
2 changes: 1 addition & 1 deletion src/stack/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def command(ctx, check_only, distribution_url):
if not os.access(shiv_binary_path, os.W_OK):
error_exit(f"Cannot write to {shiv_binary_path}. Try: sudo {shiv_binary_path} update")

timestamp_filename = f"stack-download-{datetime.datetime.now().strftime('%y%m%d-%H%M%S')}"
timestamp_filename = f"stack-download-{datetime.datetime.now().strftime("%y%m%d-%H%M%S")}"
temp_download_path = shiv_binary_path.parent.joinpath(timestamp_filename)
# Download the file to a temp filename
log_debug(f"Downloading from: {distribution_url} to {temp_download_path}")
Expand Down