diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-08 18:09:24 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-08 18:09:24 -0700 |
commit | 707e310c2aade8bd1cd024b008f5ecfeb4155063 (patch) | |
tree | 26c42a4bede83d09265a2d7bec00f9d110b85aaf /cloudinit/ssh_util.py | |
parent | d78bc08df59051bc0f118e990bf1a1660584c38e (diff) | |
download | vyos-cloud-init-707e310c2aade8bd1cd024b008f5ecfeb4155063.tar.gz vyos-cloud-init-707e310c2aade8bd1cd024b008f5ecfeb4155063.zip |
Remove the main function from this, seems like that should be in a test if needed.
Diffstat (limited to 'cloudinit/ssh_util.py')
-rw-r--r-- | cloudinit/ssh_util.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/cloudinit/ssh_util.py b/cloudinit/ssh_util.py index a081fbe8..1483f718 100644 --- a/cloudinit/ssh_util.py +++ b/cloudinit/ssh_util.py @@ -188,40 +188,3 @@ def parse_ssh_config(fname="/etc/ssh/sshd_config"): ret[key] = val fp.close() return(ret) - -if __name__ == "__main__": - def main(): - import sys - # usage: orig_file, new_keys, [key_prefix] - # prints out merged, where 'new_keys' will trump old - ## example - ## ### begin auth_keys ### - # ssh-rsa AAAAB3NzaC1xxxxxxxxxV3csgm8cJn7UveKHkYjJp8= smoser-work - # ssh-rsa AAAAB3NzaC1xxxxxxxxxCmXp5Kt5/82cD/VN3NtHw== smoser@brickies - # ### end authorized_keys ### - # - # ### begin new_keys ### - # ssh-rsa nonmatch smoser@newhost - # ssh-rsa AAAAB3NzaC1xxxxxxxxxV3csgm8cJn7UveKHkYjJp8= new_comment - # ### end new_keys ### - # - # Then run as: - # program auth_keys new_keys \ - # 'no-port-forwarding,command=\"echo hi world;\"' - def_prefix = None - orig_key_file = sys.argv[1] - new_key_file = sys.argv[2] - if len(sys.argv) > 3: - def_prefix = sys.argv[3] - fp = open(new_key_file) - - newkeys = [] - for line in fp.readlines(): - newkeys.append(AuthKeyEntry(line, def_prefix)) - - fp.close() - print update_authorized_keys(orig_key_file, newkeys) - - main() - -# vi: ts=4 expandtab |