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

Create a keys directory #68

Merged
merged 4 commits into from
Mar 20, 2024
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
9 changes: 8 additions & 1 deletion enabler/commands/cmd_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ def keys(ctx, kube_context_cli, bits):
private_key_filename = 'key.pem'
public_key_filename = 'key.pub'

# Check if keys directory exists
if not os.path.exists(keys_dir):
logger.info("Creating key directory...")
os.makedirs(keys_dir)
logger.info("Keys directory already exists")

# Check if the keys exist and warn user
if (
os.path.isfile(keys_dir + private_key_filename) or
Expand Down Expand Up @@ -134,6 +140,7 @@ def keys(ctx, kube_context_cli, bits):
f = open(keys_dir + public_key_filename, 'wb')
f.write(public_key)
f.close()
logger.info('Keys generated successfully.')


@cli.command('release', short_help='Make a platform release')
Expand Down Expand Up @@ -245,4 +252,4 @@ def version(ctx, kube_context_cli, submodules, repopath):
logger.info(u'\u2023' + ' Ahead by: ' + str(sm_details['commits_ahead']) + ' commits') # noqa

if 'commits_behind' in sm_details and sm_details['commits_behind'] > 0:
logger.info(u'\u2023' + ' Behind by: ' + str(sm_details['commits_behind']) + ' commits') # noqa
logger.info(u'\u2023' + ' Behind by: ' + str(sm_details['commits_behind']) + ' commits') # noqa
Empty file modified enabler/commands/cmd_setup.py
100644 → 100755
Empty file.
Loading