Re: [Cloud-init-dev] [Merge] ~tlashchova/cloud-init:fix-bug-add-unittest into cloud-init:master

2018-02-01 Thread Scott Moser
Tatiana, I'll get our c-i bot to test your branch, and pending success there, 
looks good!
-- 
https://code.launchpad.net/~tlashchova/cloud-init/+git/cloud-init/+merge/337003
Your team cloud-init commiters is requested to review the proposed merge of 
~tlashchova/cloud-init:fix-bug-add-unittest into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~tlashchova/cloud-init:fix-bug-add-unittest into cloud-init:master

2018-02-01 Thread Tatiana Kholkina
> improve your commit message, just have a 'messag'e part as well as subject.
> 
> Ie:
>Do not write invalid keys to authorized_keys
> 
>This fixes a bug where invalid keys would sneak into authorized_keys.

Done
-- 
https://code.launchpad.net/~tlashchova/cloud-init/+git/cloud-init/+merge/337003
Your team cloud-init commiters is requested to review the proposed merge of 
~tlashchova/cloud-init:fix-bug-add-unittest into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~tlashchova/cloud-init:fix-bug-add-unittest into cloud-init:master

2018-02-01 Thread Scott Moser
improve your commit message, just have a 'messag'e part as well as subject.

Ie:
   Do not write invalid keys to authorized_keys

   This fixes a bug where invalid keys would sneak into authorized_keys.


Diff comments:

> diff --git a/cloudinit/ssh_util.py b/cloudinit/ssh_util.py
> index b95b956..e0bcdb8 100644
> --- a/cloudinit/ssh_util.py
> +++ b/cloudinit/ssh_util.py
> @@ -172,14 +172,16 @@ def parse_authorized_keys(fname):
>  
>  def update_authorized_keys(old_entries, keys):
>  to_add = list(keys)
> -
> +print to_add

drop the 'print'

>  for i in range(0, len(old_entries)):
>  ent = old_entries[i]
>  if not ent.valid():
>  continue
>  # Replace those with the same base64
>  for k in keys:
> -if not ent.valid():
> +if not k.valid():
> +if k in to_add:
> +to_add.remove(k)
>  continue
>  if k.base64 == ent.base64:
>  # Replace it with our better one


-- 
https://code.launchpad.net/~tlashchova/cloud-init/+git/cloud-init/+merge/337003
Your team cloud-init commiters is requested to review the proposed merge of 
~tlashchova/cloud-init:fix-bug-add-unittest into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp