Skip to content

Commit

Permalink
Merge pull request #68 from keitaroinc/bugfix-platform-keys
Browse files Browse the repository at this point in the history
Create a  keys directory
  • Loading branch information
gocemitevski authored Mar 20, 2024
2 parents 588c169 + 3771944 commit 19def46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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.

0 comments on commit 19def46

Please sign in to comment.