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

Some bugfixes #315

Closed
wants to merge 1 commit into
base: trunk
from

Conversation

Projects
None yet
2 participants
@Schnitzl42
Contributor

Schnitzl42 commented Jun 10, 2014

-Mainly fixes wrong names in docstrings.
-Added admin_pass parameter to the create_node() function of OpenStack_1_1_NodeDriver.
This allows to set the root password that is assigned to a node when creating an instance with Rackspace.
-Added some imports of with_statement to be compatible to Python 2.5.
-Fixed exception when calling list_nodes() with Brightbox.
-Added locations arguments to Brightboxs list_images() to avoid exceptions when providing a location argument.

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Jun 11, 2014

Member

Looks good, but can you please sync your branch with trunk and squash all the commits (https://libcloud.readthedocs.org/en/latest/development.html#squash-the-commits-and-generate-the-patch) so it's easier for me to merge the patch (currently I get conflicts when trying to apply the patch)?

Member

Kami commented Jun 11, 2014

Looks good, but can you please sync your branch with trunk and squash all the commits (https://libcloud.readthedocs.org/en/latest/development.html#squash-the-commits-and-generate-the-patch) so it's easier for me to merge the patch (currently I get conflicts when trying to apply the patch)?

Show outdated Hide outdated libcloud/compute/drivers/ec2.py
@@ -1789,7 +1789,7 @@ def ex_create_image_from_node(self, node, name, block_device_mapping,
params = {'Action': 'CreateImage',
'InstanceId': node.id,
'Name': name,
'Reboot': reboot}
'NoReboot': reboot}

This comment has been minimized.

@Kami

Kami Jun 11, 2014

Member

You changed it to use the reversed API argument, this means you should also negate the reboot argument here (not reboot), right?

@Kami

Kami Jun 11, 2014

Member

You changed it to use the reversed API argument, this means you should also negate the reboot argument here (not reboot), right?

This comment has been minimized.

@Schnitzl42

Schnitzl42 Jun 11, 2014

Contributor

The simplest solution would be to rename "reboot" to "no_reboot",

but I try to avoid changing the signature of ex_create_image_from_node().

To keep "reboot" I could change the docstring to explain the reversed meaning of "reboot".

(setting "reboot" to false causes a reboot...)

To reverse "reboot" using "not reboot" I'd have to change the default value of "reboot" to true.

Gesendet: Mittwoch, 11. Juni 2014 um 10:00 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

In libcloud/compute/drivers/ec2.py:

@@ -1789,7 +1789,7 @@ def ex_create_image_from_node(self, node, name, block_device_mapping,
params = {'Action': 'CreateImage',
'InstanceId': node.id,
'Name': name,

  •              'Reboot': reboot}
    
  •              'NoReboot': reboot}
    

You changed it to use the reversed API argument, this means you should also negate the reboot argument here (not reboot), right?


Reply to this email directly or view it on GitHub.

@Schnitzl42

Schnitzl42 Jun 11, 2014

Contributor

The simplest solution would be to rename "reboot" to "no_reboot",

but I try to avoid changing the signature of ex_create_image_from_node().

To keep "reboot" I could change the docstring to explain the reversed meaning of "reboot".

(setting "reboot" to false causes a reboot...)

To reverse "reboot" using "not reboot" I'd have to change the default value of "reboot" to true.

Gesendet: Mittwoch, 11. Juni 2014 um 10:00 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

In libcloud/compute/drivers/ec2.py:

@@ -1789,7 +1789,7 @@ def ex_create_image_from_node(self, node, name, block_device_mapping,
params = {'Action': 'CreateImage',
'InstanceId': node.id,
'Name': name,

  •              'Reboot': reboot}
    
  •              'NoReboot': reboot}
    

You changed it to use the reversed API argument, this means you should also negate the reboot argument here (not reboot), right?


Reply to this email directly or view it on GitHub.

This comment has been minimized.

@Kami

Kami Jun 11, 2014

Member

I actually think it's better to not expose "implementation details" to the user and call the argument reboot, not not_reboot.

It's more natural for the user / developer if the argument represents a "positive" and not "negative" action.

@Kami

Kami Jun 11, 2014

Member

I actually think it's better to not expose "implementation details" to the user and call the argument reboot, not not_reboot.

It's more natural for the user / developer if the argument represents a "positive" and not "negative" action.

Show outdated Hide outdated libcloud/compute/drivers/ec2.py
@@ -2274,7 +2274,11 @@ def create_image(self, node, name, description=None, reboot=False,
params = {'Action': 'CreateImage',
'InstanceId': node.id,
'Name': name,
<<<<<<< HEAD

This comment has been minimized.

@Kami

Kami Jun 11, 2014

Member

Need to resolve this conflict

@Kami

Kami Jun 11, 2014

Member

Need to resolve this conflict

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Jun 12, 2014

Member

@Schnitzl42 Can you please also fix test and lint issues (https://travis-ci.org/apache/libcloud/builds/27384671) and then squash the commits?

Member

Kami commented Jun 12, 2014

@Schnitzl42 Can you please also fix test and lint issues (https://travis-ci.org/apache/libcloud/builds/27384671) and then squash the commits?

@Schnitzl42

This comment has been minimized.

Show comment
Hide comment
@Schnitzl42

Schnitzl42 Jun 13, 2014

Contributor

Currently Ive got pretty much to do. Im also facing troubles with my local git repository.

Therefore, fixing this issue and uploading a patch can take 2-3 week in the worst case.

I apologize for any inconvenience.

 

Gesendet: Donnerstag, 12. Juni 2014 um 12:47 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

@Schnitzl42 Can you please also fix test and lint issues (https://travis-ci.org/apache/libcloud/builds/27384671) and then squash the commits?


Reply to this email directly or view it on GitHub.

Contributor

Schnitzl42 commented Jun 13, 2014

Currently Ive got pretty much to do. Im also facing troubles with my local git repository.

Therefore, fixing this issue and uploading a patch can take 2-3 week in the worst case.

I apologize for any inconvenience.

 

Gesendet: Donnerstag, 12. Juni 2014 um 12:47 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

@Schnitzl42 Can you please also fix test and lint issues (https://travis-ci.org/apache/libcloud/builds/27384671) and then squash the commits?


Reply to this email directly or view it on GitHub.

@Schnitzl42

This comment has been minimized.

Show comment
Hide comment
@Schnitzl42

Schnitzl42 Jun 29, 2014

Contributor

After fixing issues in my local repo I squashed the commits.

Is there a way to run lint localy?

 

Gesendet: Donnerstag, 12. Juni 2014 um 12:47 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

@Schnitzl42 Can you please also fix test and lint issues (https://travis-ci.org/apache/libcloud/builds/27384671) and then squash the commits?


Reply to this email directly or view it on GitHub.

Contributor

Schnitzl42 commented Jun 29, 2014

After fixing issues in my local repo I squashed the commits.

Is there a way to run lint localy?

 

Gesendet: Donnerstag, 12. Juni 2014 um 12:47 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

@Schnitzl42 Can you please also fix test and lint issues (https://travis-ci.org/apache/libcloud/builds/27384671) and then squash the commits?


Reply to this email directly or view it on GitHub.

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Jun 29, 2014

Member

@Schnitzl42 Yes, run tox -e lint.

Member

Kami commented Jun 29, 2014

@Schnitzl42 Yes, run tox -e lint.

fixed wrong name in docstring
fixed naming error in docstring

fixed wrong docstring

fixed wrong name in docstring

fixed wrong name in docstring

fixed wrong name in docstring

added adminPass parameter to create node. Allows setting the root password when creating a node

added location to signature, to keep compatibility with super class method

fixed wrong name in docstring

fixed wrong name in docstring

fixed 'NoneType' object is unsubscriptable - exception when calling list_nodes

reordered docstring

added missing colon in docstring

added imports for with statement for python 2.5 compability

style guide test commit

fixed intendation characters

fixed wrong syntax

fixed wrong syntax really
@Schnitzl42

This comment has been minimized.

Show comment
Hide comment
@Schnitzl42

Schnitzl42 Jun 29, 2014

Contributor

I resolved the errors. How can I commit the patch? Because I didn't create a jira ticket.

 

Gesendet: Sonntag, 29. Juni 2014 um 14:04 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

@Schnitzl42 Yes, run tox -e lint.


Reply to this email directly or view it on GitHub.

Contributor

Schnitzl42 commented Jun 29, 2014

I resolved the errors. How can I commit the patch? Because I didn't create a jira ticket.

 

Gesendet: Sonntag, 29. Juni 2014 um 14:04 UhrVon: "Tomaz Muraus" notifications@github.comAn: apache/libcloud libcloud@noreply.github.comCc: Schnitzl42 m.devich@gmx.atBetreff: Re: [libcloud] Some bugfixes (#315)

@Schnitzl42 Yes, run tox -e lint.


Reply to this email directly or view it on GitHub.

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Jun 29, 2014

Member

@Schnitzl42 It's fine, I can generate the patch and merge your changes directly.

Member

Kami commented Jun 29, 2014

@Schnitzl42 It's fine, I can generate the patch and merge your changes directly.

@Schnitzl42 Schnitzl42 closed this Jun 29, 2014

asfgit pushed a commit that referenced this pull request Jun 29, 2014

Fix docstrings, add ex_admin_pass argument to create_node
in the Openstack driver.

Closes #315

Signed-off-by: Tomaz Muraus <tomaz@apache.org>
@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Jun 29, 2014

Member

Merged into trunk. Thanks.

Member

Kami commented Jun 29, 2014

Merged into trunk. Thanks.

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