New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ssh key management for softlayer #321

Closed
wants to merge 23 commits into
base: trunk
from

Conversation

Projects
None yet
2 participants
@Itxaka
Contributor

Itxaka commented Jun 22, 2014

This pull requests add ssh key management for the SoftLayer driver.

Add methods for:
list_key_pairs()
get_key_pair()
import_key_pair_from_string()
delete_key_pair()
create_key_pair()

It also adds a new property to create node "ex_keyname" which is the name of the key to be associated to the new node.

Added tests for all methods and modified the test_create_node() test to use a sshkey as well.

Itxaka and others added some commits Jun 21, 2014

First round of changes: Add Keypar object as in other drivers, add ss…
…h_key as a feature for the driver, associate the key to the node on create_node if a key name is used, added list_keypairs method to get all keys on the account, add key_name_to_id method to use the id on creating the node by providing the label
Itxaka
make _key_name_to_id return the id instead of the whole key, make get…
…_key_pair get just one key instead of getting all of them and then check the results
Add ssh key management to SoftLayer driver. Adds methods for add/remo…
…ve/get_one/get_all/import_from_string. Adds tests for all new methods.
@Kami

View changes

Show outdated Hide outdated libcloud/compute/drivers/softlayer.py
@Itxaka

This comment has been minimized.

Show comment
Hide comment
@Itxaka

Itxaka Jun 22, 2014

Contributor

Fixed the Keypar stuff that @Kami brougth to my attention. Im guessing that the way of storing extra stuff for the Keypairs is to use the extra field, so that's where I stored the ID of the key :D

Contributor

Itxaka commented Jun 22, 2014

Fixed the Keypar stuff that @Kami brougth to my attention. Im guessing that the way of storing extra stuff for the Keypairs is to use the extra field, so that's where I stored the ID of the key :D

@Itxaka

This comment has been minimized.

Show comment
Hide comment
@Itxaka

Itxaka Jul 14, 2014

Contributor

Any update if this is gonna be merged @Kami ?

Contributor

Itxaka commented Jul 14, 2014

Any update if this is gonna be merged @Kami ?

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Aug 30, 2014

Member

@Itxaka Really sorry for the delay.

I will review it again now and try to get it merged asap.

Member

Kami commented Aug 30, 2014

@Itxaka Really sorry for the delay.

I will review it again now and try to get it merged asap.

@Kami

View changes

Show outdated Hide outdated libcloud/compute/drivers/softlayer.py
@Kami

View changes

Show outdated Hide outdated libcloud/compute/drivers/softlayer.py
@Kami

View changes

Show outdated Hide outdated libcloud/compute/drivers/softlayer.py
@Kami

View changes

Show outdated Hide outdated libcloud/compute/drivers/softlayer.py
@Kami

View changes

Show outdated Hide outdated libcloud/compute/drivers/softlayer.py
@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Aug 30, 2014

Member

There are some minor style things which need to be addressed, but besides that it looks good.

I will get it merged into trunk as soon as those comments are addressed.

Thanks!

Member

Kami commented Aug 30, 2014

There are some minor style things which need to be addressed, but besides that it looks good.

I will get it merged into trunk as soon as those comments are addressed.

Thanks!

@Itxaka

This comment has been minimized.

Show comment
Hide comment
@Itxaka

Itxaka Aug 30, 2014

Contributor

@Kami thanks for the comments, will try to fix them as soon as possible.

Regarding the sshkey stuff, I still don't know if getting the local generation for ssh keys before uploading its an ok thing and could be implemented across libcloud.

Thing is, some(all?) of the cloud providers allow you to import an ssh key, but for that we need a method to generate one, upload the public part and return to the user the keypair object (public and private) so I believe it would be good if it could be used across all drivers as a new generic method. For automation purpouses it makes too much sense (we are doing it that way internally, on node creation we generate a new key from scratch for each machine, but as libcloud does not support it we are doing it outside of it)

It requires a new dependecy thougth, pycrypto.

Cheers!

Contributor

Itxaka commented Aug 30, 2014

@Kami thanks for the comments, will try to fix them as soon as possible.

Regarding the sshkey stuff, I still don't know if getting the local generation for ssh keys before uploading its an ok thing and could be implemented across libcloud.

Thing is, some(all?) of the cloud providers allow you to import an ssh key, but for that we need a method to generate one, upload the public part and return to the user the keypair object (public and private) so I believe it would be good if it could be used across all drivers as a new generic method. For automation purpouses it makes too much sense (we are doing it that way internally, on node creation we generate a new key from scratch for each machine, but as libcloud does not support it we are doing it outside of it)

It requires a new dependecy thougth, pycrypto.

Cheers!

@Itxaka

This comment has been minimized.

Show comment
Hide comment
@Itxaka

Itxaka Aug 31, 2014

Contributor

@Kami Everything modified to confirm to the proper guidelines and all tests passing :)

Contributor

Itxaka commented Aug 31, 2014

@Kami Everything modified to confirm to the proper guidelines and all tests passing :)

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Aug 31, 2014

Member

@Itxaka Thanks.

I'm having troubles applying this patch on top of trunk (I would squash the commits myself). Can you please sync your branch with latest trunk and squash all the commits?

In the worst case, if you are also having troubles, just sync your branch with trunk, do git diff --no-prefix trunk > t.diff, create new branch, git apply t.diff and commit all the changes under a single commit.

Member

Kami commented Aug 31, 2014

@Itxaka Thanks.

I'm having troubles applying this patch on top of trunk (I would squash the commits myself). Can you please sync your branch with latest trunk and squash all the commits?

In the worst case, if you are also having troubles, just sync your branch with trunk, do git diff --no-prefix trunk > t.diff, create new branch, git apply t.diff and commit all the changes under a single commit.

@Itxaka

This comment has been minimized.

Show comment
Hide comment
@Itxaka

Itxaka Aug 31, 2014

Contributor

Having issues, will recreate the branch and a new pull request.

Contributor

Itxaka commented Aug 31, 2014

Having issues, will recreate the branch and a new pull request.

@Itxaka Itxaka closed this Aug 31, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment