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
1 change: 1 addition & 0 deletions src/azure-cli-core/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Release History
===============

2.0.52
++++++
* Fix bug where ids piped from a command with tsv output is improperly parsed.
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def generate_ssh_keys(private_key_filepath, public_key_filepath):
try:
key = paramiko.RSAKey(filename=private_key_filepath)
logger.warning("Private SSH key file '%s' was found in the directory: '%s'. "
"We will generate a paired public key file '%s'",
"A paired public key file '%s' will be generated.",
private_key_filepath, ssh_dir, public_key_filepath)
except (PasswordRequiredException, SSHException, IOError) as e:
raise CLIError(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,15 +605,9 @@ def _generate_ssh_keys():
"""Generates ssh keys pair"""
private_key_path = os.path.join(os.path.expanduser('~'), '.ssh', 'id_rsa')
public_key_path = os.path.join(os.path.expanduser('~'), '.ssh', 'id_rsa.pub')
if os.path.exists(private_key_path) and os.path.exists(public_key_path):
logger.warning('Reusing existing ssh public key from ~/.ssh')
return
if os.path.exists(private_key_path):
logger.warning('SSH private key id_rsa exists but public key is missing. Please export the public key.')
return
keys.generate_ssh_keys(private_key_path, public_key_path)
logger.warning('SSH key files id_rsa and id_rsa.pub have been generated under ~/.ssh to allow SSH access to the '
'nodes. If using machines without permanent storage, back up your keys to a safe location.')
logger.warning('Attempted to find or generate SSH key files id_rsa and id_rsa.pub under ~/.ssh to allow SSH access '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not so sure we need this warning any more, as azure-cli-core already emits out a warning based the context, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does in most cases. However, with this change no message will be printed if a new private key file is generated. In the past there was always a message printed. Still, this should be expected as the help text for --generate-ssh-keys in az batchai cluster/file-server create -h says: "Generate SSH public and private key files in ~/.ssh directory (if missing)."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will go ahead and remove this warning.

'to the nodes. If using machines without permanent storage, back up your keys to a safe location.')


def list_workspaces(client, resource_group=None):
Expand Down