whitespace cleanups

This commit is contained in:
termie 2011-08-08 13:20:44 -07:00
parent 2d785404ed
commit 536be15a87
23 changed files with 31 additions and 50 deletions

@ -185,10 +185,10 @@ All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.

@ -21,7 +21,7 @@ Development takes place on GitHub__. Bug reports and patches may be filed there.
__ https://github.com/rackspace/python-client __ https://github.com/rackspace/python-client
This code a fork of `Jacobian's python-cloudservers`__ If you need API support This code a fork of `Jacobian's python-cloudservers`__ If you need API support
for the Rackspace API soley or the BSD license, you should use that repository. for the Rackspace API soley or the BSD license, you should use that repository.
python-client is licensed under the Apache License like the rest of OpenStack. python-client is licensed under the Apache License like the rest of OpenStack.
__ http://github.com/jacobian/python-cloudservers __ http://github.com/jacobian/python-cloudservers
@ -36,7 +36,7 @@ Installing this package gets you a shell command, ``nova``, that you
can use to interact with any Rackspace compatible API (including OpenStack). can use to interact with any Rackspace compatible API (including OpenStack).
You'll need to provide your OpenStack username and API key. You can do this You'll need to provide your OpenStack username and API key. You can do this
with the ``--username``, ``--apikey`` and ``--projectid`` params, but it's easier to just with the ``--username``, ``--apikey`` and ``--projectid`` params, but it's easier to just
set them as environment variables:: set them as environment variables::
export NOVA_USERNAME=openstack export NOVA_USERNAME=openstack
@ -44,13 +44,13 @@ set them as environment variables::
export NOVA_PROJECT_ID=myproject export NOVA_PROJECT_ID=myproject
You will also need to define the authentication url with ``--url`` and the You will also need to define the authentication url with ``--url`` and the
version of the API with ``--version``. Or set them as an environment version of the API with ``--version``. Or set them as an environment
variables as well:: variables as well::
export NOVA_URL=http://myserver:port/v1.0/ export NOVA_URL=http://myserver:port/v1.0/
export NOVA_VERSION=1.0 export NOVA_VERSION=1.0
You'll find complete documentation on the shell by running You'll find complete documentation on the shell by running
``nova help``:: ``nova help``::
usage: nova [--username USERNAME] [--apikey APIKEY] [--projectid PROJECTID] usage: nova [--username USERNAME] [--apikey APIKEY] [--projectid PROJECTID]
@ -111,11 +111,11 @@ You'll find complete documentation on the shell by running
--url AUTH_URL Defaults to env[NOVA_URL] or --url AUTH_URL Defaults to env[NOVA_URL] or
https://auth.api.rackspacecloud.com/v1.0 https://auth.api.rackspacecloud.com/v1.0
if undefined. if undefined.
--version VERSION Accepts 1.0 or 1.1, defaults to --version VERSION Accepts 1.0 or 1.1, defaults to
env[NOVA_VERSION]. env[NOVA_VERSION].
See "nova help COMMAND" for help on a specific command. See "nova help COMMAND" for help on a specific command.
Python API Python API
---------- ----------
@ -132,13 +132,13 @@ By way of a quick-start::
>>> nt.servers.list() >>> nt.servers.list()
[...] [...]
>>> s = nt.servers.create(image=2, flavor=1, name='myserver') >>> s = nt.servers.create(image=2, flavor=1, name='myserver')
... time passes ... ... time passes ...
>>> s.reboot() >>> s.reboot()
... time passes ... ... time passes ...
>>> s.delete() >>> s.delete()
What's new? What's new?

@ -3,7 +3,7 @@ The :mod:`novaclient` Python API
.. module:: novaclient .. module:: novaclient
:synopsis: A client for the OpenStack Nova API. :synopsis: A client for the OpenStack Nova API.
.. currentmodule:: novaclient .. currentmodule:: novaclient
Usage Usage
@ -17,28 +17,28 @@ First create an instance of :class:`OpenStack` with your credentials::
Then call methods on the :class:`OpenStack` object: Then call methods on the :class:`OpenStack` object:
.. class:: OpenStack .. class:: OpenStack
.. attribute:: backup_schedules .. attribute:: backup_schedules
A :class:`BackupScheduleManager` -- manage automatic backup images. A :class:`BackupScheduleManager` -- manage automatic backup images.
.. attribute:: flavors .. attribute:: flavors
A :class:`FlavorManager` -- query available "flavors" (hardware A :class:`FlavorManager` -- query available "flavors" (hardware
configurations). configurations).
.. attribute:: images .. attribute:: images
An :class:`ImageManager` -- query and create server disk images. An :class:`ImageManager` -- query and create server disk images.
.. attribute:: ipgroups .. attribute:: ipgroups
A :class:`IPGroupManager` -- manage shared public IP addresses. A :class:`IPGroupManager` -- manage shared public IP addresses.
.. attribute:: servers .. attribute:: servers
A :class:`ServerManager` -- start, stop, and manage virtual machines. A :class:`ServerManager` -- start, stop, and manage virtual machines.
.. automethod:: authenticate .. automethod:: authenticate
For example:: For example::
@ -63,5 +63,5 @@ For more information, see the reference:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
ref/index ref/index

@ -21,7 +21,7 @@ Contents:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
shell shell
api api
ref/index ref/index

@ -1,4 +1,3 @@
import prettytable import prettytable

@ -1,4 +1,3 @@
from novaclient import base from novaclient import base
from novaclient.v1_0 import base as local_base from novaclient.v1_0 import base as local_base

@ -2,8 +2,8 @@
A fake server that "responds" to API methods with pre-canned responses. A fake server that "responds" to API methods with pre-canned responses.
All of these responses come from the spec, so if for some reason the spec's All of these responses come from the spec, so if for some reason the spec's
wrong the tests might raise AssertionError. I've indicated in comments the wrong the tests might raise AssertionError. I've indicated in comments the places where actual
places where actual behavior differs from the spec. behavior differs from the spec.
""" """
import novaclient.client import novaclient.client
@ -17,8 +17,7 @@ def assert_has_keys(dict, required=[], optional=[]):
except AssertionError: except AssertionError:
allowed_keys = set(required) | set(optional) allowed_keys = set(required) | set(optional)
extra_keys = set(keys).difference(set(required + optional)) extra_keys = set(keys).difference(set(required + optional))
raise AssertionError("found unexpected keys: %s" % raise AssertionError("found unexpected keys: %s" % list(extra_keys))
list(extra_keys))
class FakeClient(object): class FakeClient(object):

@ -1,4 +1,3 @@
import mock import mock
from novaclient import base from novaclient import base

@ -1,4 +1,3 @@
import httplib2 import httplib2
import mock import mock

@ -1,4 +1,3 @@
import os import os
import mock import mock
import httplib2 import httplib2

@ -1,4 +1,3 @@
import StringIO import StringIO
from tests.v1_0 import fakes from tests.v1_0 import fakes

@ -1,4 +1,3 @@
import httplib2 import httplib2
import mock import mock

@ -1,4 +1,3 @@
from novaclient.v1_0 import backup_schedules from novaclient.v1_0 import backup_schedules
from tests.v1_0 import fakes from tests.v1_0 import fakes
from tests import utils from tests import utils

@ -1,4 +1,3 @@
from novaclient import exceptions from novaclient import exceptions
from novaclient.v1_0 import flavors from novaclient.v1_0 import flavors
from tests.v1_0 import fakes from tests.v1_0 import fakes

@ -1,4 +1,3 @@
from novaclient.v1_0 import images from novaclient.v1_0 import images
from tests.v1_0 import fakes from tests.v1_0 import fakes
from tests import utils from tests import utils

@ -1,4 +1,3 @@
from novaclient.v1_0 import ipgroups from novaclient.v1_0 import ipgroups
from tests.v1_0 import fakes from tests.v1_0 import fakes
from tests import utils from tests import utils

@ -1,4 +1,3 @@
import StringIO import StringIO
from novaclient.v1_0 import servers from novaclient.v1_0 import servers

@ -1,4 +1,3 @@
import os import os
import mock import mock

@ -1,4 +1,3 @@
from novaclient import exceptions from novaclient import exceptions
from novaclient.v1_1 import flavors from novaclient.v1_1 import flavors
from tests.v1_1 import fakes from tests.v1_1 import fakes

@ -1,4 +1,3 @@
from novaclient.v1_1 import images from novaclient.v1_1 import images
from tests.v1_1 import fakes from tests.v1_1 import fakes
from tests import utils from tests import utils

@ -1,4 +1,3 @@
import StringIO import StringIO
from novaclient.v1_1 import servers from novaclient.v1_1 import servers

@ -1,4 +1,3 @@
import os import os
import mock import mock

@ -1,4 +1,3 @@
import StringIO import StringIO
from novaclient.v1_1 import zones from novaclient.v1_1 import zones