Repository: libcloud Updated Branches: refs/heads/trunk 6e8ad2de6 -> 5e5f7a5f6
Fix docstring issues causing sphinx warnings. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/bed9fb67 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/bed9fb67 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/bed9fb67 Branch: refs/heads/trunk Commit: bed9fb67875fec60ab829d3d23ad14c5a7069762 Parents: 6e8ad2d Author: Tomaz Muraus <to...@tomaz.me> Authored: Wed Dec 30 15:29:03 2015 +0800 Committer: Tomaz Muraus <to...@tomaz.me> Committed: Wed Dec 30 15:49:02 2015 +0800 ---------------------------------------------------------------------- libcloud/common/google.py | 9 +++---- libcloud/common/openstack.py | 38 +++++++++++++++++------------ libcloud/compute/deployment.py | 2 +- libcloud/compute/drivers/abiquo.py | 4 +-- libcloud/compute/drivers/azure.py | 32 ++++++++++++------------ libcloud/compute/drivers/cloudsigma.py | 4 +-- libcloud/compute/drivers/cloudstack.py | 5 ++-- 7 files changed, 51 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/bed9fb67/libcloud/common/google.py ---------------------------------------------------------------------- diff --git a/libcloud/common/google.py b/libcloud/common/google.py index b881506..07cf553 100644 --- a/libcloud/common/google.py +++ b/libcloud/common/google.py @@ -21,8 +21,8 @@ Information about setting up your Google OAUTH2 credentials: For libcloud, there are two basic methods for authenticating to Google using OAUTH2: Service Accounts and Client IDs for Installed Applications. -Both are initially set up from the Cloud Console_ -_Console: https://cloud.google.com/console +Both are initially set up from the Cloud Console Console - +https://cloud.google.com/console Setting up Service Account authentication (note that you need the PyCrypto package installed to use this): @@ -38,9 +38,7 @@ package installed to use this): - Optionally, you may choose to Generate a PKCS12 key from the Console. It needs to be converted to the PEM format. Please note, the PKCS12 format is deprecated and may be removed in a future release. - - Convert the key using OpenSSL (the default password is 'notasecret'): - ``openssl pkcs12 -in YOURPRIVKEY.p12 -nodes -nocerts - -passin pass:notasecret | openssl rsa -out PRIV.pem`` + - Convert the key using OpenSSL (the default password is 'notasecret'). - Move the .pem file to a safe location. - To Authenticate, you will need to pass the Service Account's "Email address" in as the user_id and the path to the .pem file as the key. @@ -66,6 +64,7 @@ Setting up Installed Application authentication: Please remember to secure your keys and access tokens. """ + from __future__ import with_statement try: http://git-wip-us.apache.org/repos/asf/libcloud/blob/bed9fb67/libcloud/common/openstack.py ---------------------------------------------------------------------- diff --git a/libcloud/common/openstack.py b/libcloud/common/openstack.py index b6e6d6c..e63ee8a 100644 --- a/libcloud/common/openstack.py +++ b/libcloud/common/openstack.py @@ -74,40 +74,46 @@ class OpenStackBaseConnection(ConnectionUserAndKey): :type secure: ``bool`` :param ex_force_base_url: Base URL for connection requests. If - not specified, this will be determined by authenticating. + not specified, this will be determined by + authenticating. :type ex_force_base_url: ``str`` :param ex_force_auth_url: Base URL for authentication requests. :type ex_force_auth_url: ``str`` :param ex_force_auth_version: Authentication version to use. If - not specified, defaults to AUTH_API_VERSION. + not specified, defaults to AUTH_API_VERSION. :type ex_force_auth_version: ``str`` - :param ex_force_auth_token: Authentication token to use for - connection requests. If specified, the connection will not attempt - to authenticate, and the value of ex_force_base_url will be used to - determine the base request URL. If ex_force_auth_token is passed in, - ex_force_base_url must also be provided. + :param ex_force_auth_token: Authentication token to use for connection + requests. If specified, the connection will + not attempt to authenticate, and the value + of ex_force_base_url will be used to + determine the base request URL. If + ex_force_auth_token is passed in, + ex_force_base_url must also be provided. :type ex_force_auth_token: ``str`` - :param ex_tenant_name: When authenticating, provide this tenant - name to the identity service. A scoped token will be returned. - Some cloud providers require the tenant name to be provided at - authentication time. Others will use a default tenant if none - is provided. + :param ex_tenant_name: When authenticating, provide this tenant name to the + identity service. A scoped token will be returned. + Some cloud providers require the tenant name to be + provided at authentication time. Others will use a + default tenant if none is provided. :type ex_tenant_name: ``str`` :param ex_force_service_type: Service type to use when selecting an - service. If not specified, a provider specific default will be used. + service. If not specified, a provider + specific default will be used. :type ex_force_service_type: ``str`` :param ex_force_service_name: Service name to use when selecting an - service. If not specified, a provider specific default will be used. + service. If not specified, a provider + specific default will be used. :type ex_force_service_name: ``str`` - :param ex_force_service_region: Region to use when selecting an - service. If not specified, a provider specific default will be used. + :param ex_force_service_region: Region to use when selecting an service. + If not specified, a provider specific + default will be used. :type ex_force_service_region: ``str`` """ http://git-wip-us.apache.org/repos/asf/libcloud/blob/bed9fb67/libcloud/compute/deployment.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/deployment.py b/libcloud/compute/deployment.py index 018c5f8..d5f7eec 100644 --- a/libcloud/compute/deployment.py +++ b/libcloud/compute/deployment.py @@ -246,7 +246,7 @@ class MultiStepDeployment(Deployment): :type add: Single :class:`Deployment` or a ``list`` of :class:`Deployment` :keyword add: Adds this deployment to the others already in this - object. + object. """ if add is not None: add = add if isinstance(add, (list, tuple)) else [add] http://git-wip-us.apache.org/repos/asf/libcloud/blob/bed9fb67/libcloud/compute/drivers/abiquo.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/abiquo.py b/libcloud/compute/drivers/abiquo.py index f8afdfd..fdcc59d 100644 --- a/libcloud/compute/drivers/abiquo.py +++ b/libcloud/compute/drivers/abiquo.py @@ -328,8 +328,8 @@ class AbiquoNodeDriver(NodeDriver): """ Destroy a group. - Be careful! Destroying a group means destroying all the :class:`Node`s - there and the group itself! + Be careful! Destroying a group means destroying all the :class:`Node` + instances there and the group itself! If there is currently any action over any :class:`Node` of the :class:`NodeGroup`, then the method will raise an exception. http://git-wip-us.apache.org/repos/asf/libcloud/blob/bed9fb67/libcloud/compute/drivers/azure.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py index f55fce6..48a0654 100644 --- a/libcloud/compute/drivers/azure.py +++ b/libcloud/compute/drivers/azure.py @@ -954,23 +954,25 @@ class AzureNodeDriver(NodeDriver): def ex_set_instance_endpoints(self, node, endpoints, ex_deployment_slot="Production"): + """ - endpoint = ConfigurationSetInputEndpoint( - name='SSH', - protocol='tcp', - port=port, - local_port='22', - load_balanced_endpoint_set_name=None, - enable_direct_server_return=False - ) - { - 'name': 'SSH', - 'protocol': 'tcp', - 'port': port, - 'local_port': '22' - } - """ + For example:: + endpoint = ConfigurationSetInputEndpoint( + name='SSH', + protocol='tcp', + port=port, + local_port='22', + load_balanced_endpoint_set_name=None, + enable_direct_server_return=False + ) + { + 'name': 'SSH', + 'protocol': 'tcp', + 'port': port, + 'local_port': '22' + } + """ ex_cloud_service_name = node.extra['ex_cloud_service_name'] vm_role_name = node.name http://git-wip-us.apache.org/repos/asf/libcloud/blob/bed9fb67/libcloud/compute/drivers/cloudsigma.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/cloudsigma.py b/libcloud/compute/drivers/cloudsigma.py index 0b26665..02818b3 100644 --- a/libcloud/compute/drivers/cloudsigma.py +++ b/libcloud/compute/drivers/cloudsigma.py @@ -274,11 +274,11 @@ class CloudSigma_1_0_NodeDriver(CloudSigmaNodeDriver): :type name: ``str`` :keyword smp: Number of virtual processors or None to calculate - based on the cpu speed + based on the cpu speed. :type smp: ``int`` :keyword nic_model: e1000, rtl8139 or virtio (is not specified, - e1000 is used) + e1000 is used) :type nic_model: ``str`` :keyword vnc_password: If not set, VNC access is disabled. http://git-wip-us.apache.org/repos/asf/libcloud/blob/bed9fb67/libcloud/compute/drivers/cloudstack.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py index 763e3fd..33edda7 100644 --- a/libcloud/compute/drivers/cloudstack.py +++ b/libcloud/compute/drivers/cloudstack.py @@ -818,7 +818,7 @@ class CloudStackNetworkACL(object): :type id ``int`` :param protocol: the protocol for the ACL rule. Valid values are - TCP/UDP/ICMP/ALL or valid protocol number + TCP/UDP/ICMP/ALL or valid protocol number :type protocol: ``string`` :param acl_id: Name of the network ACL List @@ -837,7 +837,8 @@ class CloudStackNetworkACL(object): :type end_port: ``str`` :param traffic_type: the traffic type for the ACL,can be Ingress - or Egress, defaulted to Ingress if not specified + or Egress, defaulted to Ingress if not + specified :type traffic_type: ``str`` :rtype: :class:`CloudStackNetworkACL`