Description of problem: I can issue 2 ssh-key add commands to mcollective with the ssh key content and comment and it gets added 2 times to the authorized_keys file. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Issue mcollecitve call to add an ssh key 2. Issue same mcollective call again Actual results: Key added 2 times Expected results: Key added once and updated to latest content if it already exists. Additional info: Key comment should be used to match up which key to update.
looking into
Fixed in https://github.com/openshift/crankcase/pull/464
code is written, working on testing, will have a fix or reduce severity by tomorrow
Patch for fix in https://github.com/openshift/crankcase/pull/470
Above pull request is merged in devenv_2156
Verifed on devenv_2168 in two ways 1. Add an sshkey with the same name, it will fail: hjw@my .ssh$ rhc sshkey add default newkey1.pub Password: *** SSH key with name default already exists. Use a different name or delete conflicting key and retry. 2. On node, used a script to try to add sshkey with different content and but same comment. 1) create an application, and check the authorized_keys file from node 2) run script, add a content to the existing key, the authorized_keys should be updated with the new content script: #! /usr/bin/env ruby require '/usr/lib/ruby/gems/1.8/gems/stickshift-node-0.16.9/lib/stickshift-node/model/unix_user.rb' include StickShift t = UnixUser.new('8e8ff64316404edab3f3f76732096f5c','8e8ff64316404edab3f3f76732096f5c','8e8ff64316404edab3f3f76732096f5c') t.add_ssh_key('AAAAB3NzaC1yc2EAAAADAQABAAABAQCqAwFkqSAYFjicIHp28aIHh4Gc8T/VxWnud02/LSlPMZQ98vcPQVQlPPE9wPUhlJ00Nw5V/WaReRC5DlpJFh1b9AMWLnZA5bVaGCnmJYex5Lh72mmoVkAarxxD+Koo13yZuhObBM859dZQfPCFCr732SxtAg0Vd4roFY5r/B7TF+XoNvLc8qAzfQdgGi6JTNXH59x+3wkNGjWjc3r4+S89byZ7dIcCVo8VBrSMKsC4VbRhpZ8IRIpHbAH+/PAy/jdWcfvE+jd7HB9JnT/qqW5A5lRkfCkAtmr/YYZvFbbNhyLiS9zOxLTTEFDgmIJS05lvgHzs/bO5+4D00N1w+Yir1','ssh-rsa','default') puts $? Result: [root@ip-10-4-226-236 .ssh]# cat authorized_keys command="/usr/bin/trap-user",no-X11-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqAwFkqSAYFjicIHp28aIHh4Gc8T/VxWnud02/LSlPMZQ98vcPQVQlPPE9wPUhlJ00Nw5V/WaReRC5DlpJFh1b9AMWLnZA5bVaGCnmJYex5Lh72mmoVkAarxxD+Koo13yZuhObBM859dZQfPCFCr732SxtAg0Vd4roFY5r/B7TF+XoNvLc8qAzfQdgGi6JTNXH59x+3wkNGjWjc3r4+S89byZ7dIcCVo8VBrSMKsC4VbRhpZ8IRIpHbAH+/PAy/jdWcfvE+jd7HB9JnT/qqW5A5lRkfCkAtmr/YYZvFbbNhyLiS9zOxLTTEFDgmIJS05lvgHzs/bO5+4D00N1w+Yir1 OPENSHIFT-8e8ff64316404edab3f3f76732096f5cdefault It was updated successfully.