[Python-modules-commits] [python-shade] 02/05: Import python-shade_1.7.0.orig.tar.gz

Clint Byrum spamaps at moszumanska.debian.org
Thu May 19 13:36:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

spamaps pushed a commit to branch master
in repository python-shade.

commit 73eb0e176d283e370b8ec50ca1ab87b82b9b50f6
Author: Clint Byrum <spamaps at debian.org>
Date:   Thu May 19 06:22:29 2016 -0700

    Import python-shade_1.7.0.orig.tar.gz
---
 AUTHORS                                            |  11 +
 ChangeLog                                          | 106 +++
 PKG-INFO                                           |   2 +-
 doc/source/usage.rst                               |  18 +-
 extras/run-ansible-tests.sh                        |  45 +-
 .../notes/add_update_service-28e590a7a7524053.yaml |   6 +
 ...create_server_network_fix-c4a56b31d2850a4b.yaml |   6 +
 .../create_service_norm-319a97433d68fa6a.yaml      |   3 +
 .../notes/fip_timeout-035c4bb3ff92fa1f.yaml        |   4 +
 .../notes/flavor_fix-a53c6b326dc34a2c.yaml         |   7 +
 .../notes/get_object_api-968483adb016bce1.yaml     |   3 +
 .../grant-revoke-assignments-231d3f9596a1ae75.yaml |   3 +
 ...e-assignments-keystone-v2-b127b12b4860f50c.yaml |   3 +
 .../notes/net_provider-dd64b697476b7094.yaml       |   3 +
 .../norm_role_assignments-a13f41768e62d40c.yaml    |   4 +
 .../notes/router_ext_gw-b86582317bca8b39.yaml      |   4 +
 .../service_enabled_flag-c917b305d3f2e8fd.yaml     |   5 +
 .../notes/swift-upload-lock-d18f3d42b3a0719a.yaml  |   5 +
 .../wait-on-image-snapshot-27cd2eacab2fabd8.yaml   |   7 +
 .../notes/wait_for_server-8dc8446b7c673d36.yaml    |   3 +
 setup.cfg                                          |   2 +-
 shade.egg-info/PKG-INFO                            |   2 +-
 shade.egg-info/SOURCES.txt                         |  22 +
 shade.egg-info/pbr.json                            |   2 +-
 shade/_tasks.py                                    |  80 +-
 shade/_utils.py                                    | 207 ++++-
 shade/cmd/inventory.py                             |   5 +-
 shade/exc.py                                       |   4 +
 shade/inventory.py                                 |  39 +-
 shade/meta.py                                      |  34 +-
 shade/openstackcloud.py                            | 715 ++++++++++++++---
 shade/operatorcloud.py                             | 376 +++++++--
 shade/task_manager.py                              |  67 +-
 shade/tests/ansible/hooks/post_test_hook.sh        |  20 +-
 shade/tests/ansible/roles/router/tasks/main.yml    |   8 +-
 shade/tests/ansible/roles/server/tasks/main.yml    |  68 ++
 shade/tests/ansible/roles/server/vars/main.yaml    |   3 +
 shade/tests/ansible/run.yml                        |   1 +
 shade/tests/fakes.py                               |  51 +-
 shade/tests/functional/base.py                     |  33 +
 shade/tests/functional/hooks/post_test_hook.sh     |   9 +
 shade/tests/functional/test_compute.py             | 129 ++--
 shade/tests/functional/test_domain.py              |  29 +-
 shade/tests/functional/test_endpoints.py           |   6 +-
 shade/tests/functional/test_flavor.py              |  58 +-
 shade/tests/functional/test_floating_ip.py         |  73 +-
 shade/tests/functional/test_floating_ip_pool.py    |  10 +-
 shade/tests/functional/test_groups.py              |  35 +-
 shade/tests/functional/test_identity.py            | 169 +++-
 shade/tests/functional/test_image.py               |  48 +-
 shade/tests/functional/test_inventory.py           |  10 +-
 shade/tests/functional/test_network.py             |  39 +-
 shade/tests/functional/test_object.py              |  37 +-
 shade/tests/functional/test_port.py                |  44 +-
 shade/tests/functional/test_range_search.py        | 125 +++
 shade/tests/functional/test_router.py              |  69 +-
 shade/tests/functional/test_services.py            |  31 +-
 shade/tests/functional/test_users.py               |  78 +-
 shade/tests/functional/test_volume.py              |  46 +-
 shade/tests/unit/base.py                           |  37 +
 shade/tests/unit/test__utils.py                    | 166 ++++
 shade/tests/unit/test_caching.py                   | 200 +++--
 shade/tests/unit/test_create_server.py             | 141 +++-
 shade/tests/unit/test_domain_params.py             |   4 -
 shade/tests/unit/test_endpoints.py                 | 105 ++-
 shade/tests/unit/test_flavors.py                   |  36 +-
 shade/tests/unit/test_floating_ip_neutron.py       | 124 ++-
 shade/tests/unit/test_identity_roles.py            |  66 +-
 shade/tests/unit/test_image.py                     |  98 +++
 shade/tests/unit/test_image_snapshot.py            |  54 ++
 shade/tests/unit/test_inventory.py                 |  45 +-
 shade/tests/unit/test_keypair.py                   |   4 -
 shade/tests/unit/test_meta.py                      | 162 ++--
 shade/tests/unit/test_network.py                   |  71 +-
 shade/tests/unit/test_object.py                    |  48 +-
 shade/tests/unit/test_rebuild_server.py            |  39 +
 shade/tests/unit/test_role_assignment.py           | 859 +++++++++++++++++++++
 shade/tests/unit/test_security_groups.py           |   4 -
 shade/tests/unit/test_services.py                  |  69 +-
 shade/tests/unit/test_shade.py                     | 281 +++++--
 shade/tests/unit/test_stack.py                     |  18 +-
 shade/tests/unit/test_task_manager.py              |   6 -
 shade/tests/unit/test_users.py                     |  25 +
 shade/tests/unit/test_volume.py                    |  22 +-
 test-requirements.txt                              |   1 +
 tox.ini                                            |   3 +
 86 files changed, 4819 insertions(+), 901 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index ce8acbf..783fb59 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,27 +2,38 @@ Adam Gandelman <adamg at ubuntu.com>
 Alberto Gireud <agireud at us.ibm.com>
 Atsushi SAKAI <sakaia at jp.fujitsu.com>
 Caleb Boylan <calebboylan at gmail.com>
+Cedric Brandily <zzelle at gmail.com>
 Clark Boylan <clark.boylan at gmail.com>
 Clayton O'Neill <clayton at oneill.net>
 Clint Byrum <clint at fewbar.com>
+Daniel Wallace <danielwallace at gtmanfred.com>
 David Shrewsbury <shrewsbury.dave at gmail.com>
 Davide Guerri <davide.guerri at gmail.com>
 Devananda van der Veen <devananda.vdv at gmail.com>
 Ghe Rivero <ghe.rivero at hp.com>
 Gregory Haynes <greg at greghaynes.net>
 Haikel Guemar <hguemar at fedoraproject.org>
+Hideki Saito <saito at fgrep.org>
+Ian Wienand <iwienand at redhat.com>
 James E. Blair <jeblair at linux.vnet.ibm.com>
 Jeremy Stanley <fungi at yuggoth.org>
+Jon Schlueter <jschluet at redhat.com>
 Joshua Harlow <harlowja at yahoo-inc.com>
+Joshua Hesketh <josh at nitrotech.org>
 Julia Kreger <juliaashleykreger at gmail.com>
 Kyle Mestery <mestery at mestery.com>
 Lars Kellogg-Stedman <lars at redhat.com>
+Mathieu Bultel <mbultel at redhat.com>
 Matthew Treinish <mtreinish at kortar.org>
 Monty Taylor <mordred at inaugust.com>
 Morgan Fainberg <morgan.fainberg at gmail.com>
 Ricardo Carrillo Cruz <ricardo.carrillo.cruz at gmail.com>
 Rosario Di Somma <rosario.disomma at dreamhost.com>
+SamYaple <sam at yaple.net>
+Spencer Krum <nibz at spencerkrum.com>
+Stefan Andres <s.andres at syseleven.de>
 Steve Leon <kokhang at gmail.com>
 Timothy Chavez <timothy.chavez at hp.com>
+Tristan Cacqueray <tdecacqu at redhat.com>
 Yolanda Robla <yolanda.robla-mota at hp.com>
 matthew wagoner <zxkuqyb at gmail.com>
diff --git a/ChangeLog b/ChangeLog
index fc35e6d..e8bcda0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,112 @@
 CHANGES
 =======
 
+1.7.0
+-----
+
+* Cache ports like servers
+* Workaround multiple private network ports
+* Reset network caches after network create/delete
+* Fix test_list_servers unit test
+* Fix test_get_server_ip unit test
+* Remove duplicate FakeServer class from unit tests
+* Mutex protect internal/external network detection
+* Support provider networks in public network detection
+* Re-allow list of networks for FIP assignment
+* Support InsecureRequestWarning == None
+* Add release notes for new create_image_snapshot() args
+* Split waiting for images into its own method
+
+1.6.2
+-----
+
+* Add wait support to create_image_snapshot()
+* Also add server interfaces for server get
+* Import os module as it is referenced in line 2097
+* Fix grant_role docstring
+
+1.6.1
+-----
+
+* Add default value to wait parameter
+
+1.6.0
+-----
+
+* Use OpenStackCloudException when _delete_server(
+* Always do network interface introspection
+* Fix race condition in deleting volumes
+* Use direct requests for flavor extra_specs set/unset
+* Fix search_projects docstring
+* Fix search_users docstring
+* Deal with is_public and ephemeral in normalize_flavors
+* Create clouds in Functional Test base class
+* Run extra specs through TaskManager and use requests
+* Bug fix: Make set/unset of flavor specs work again
+* Refactor unit tests to construct cloud in base
+* Add constructor param to turn on inner logging
+* Log inner_exception in test runs
+* Add environment_files to stack_create
+* Add normalize stack function for heat stack_list
+* Add wait_for_server API call
+* Update create_endpoint()
+* Test v3 params on v2.0 endpoint; Add v3 unit
+* Add update_service()
+* Use network in neutron_available_floating_ips
+* Allow passing project_id to create_network
+
+1.5.1
+-----
+
+* In the service lock, reset the service, not the lock
+* Bug fix: Do not fail on routers with no ext gw
+
+1.5.0
+-----
+
+* Mock glance v1 image with object not dict
+* Use warlock in the glance v2 tests
+* Fixes for latest cinder and neutron clients
+* Add debug message about file hash calculation
+* Pass username/password to SwiftService
+* Also reset swift service object at upload time
+* Invalidate volume cache when waiting for attach
+* Use isinstance() for result type checking
+* Add test for os_server Ansible module
+* Fix create_server() with a named network
+* os_router playbook cleanup
+* Fix heat create_stack and delete_stack
+* Catch failures with particular clouds
+* Allow testing against Ansible dev branch
+* Recognize subclasses of list types
+* Add ability to pass just filename to create_image
+* Add support for provider network options
+* Remove mock testing of os-client-config for swift
+* Add a method to download an image from glance
+* Add test option to use Ansible source repo
+* Add enabled flag to keystone service data
+* Clarify Munch object usage in documentation
+* Add docs tox target
+* create_service() should normalize return value
+* Prepare functional test subunit stream for collection
+* Use release version of Ansible for testing
+* Modify test workaround for extra_dhcp_opts
+* Fix for stable/liberty job
+* granting and revoking privs to users and groups
+* Add release note for FIP timeout fix
+* include keystonev2 role assignments
+* Add release note for new get_object() API call
+* Pass timeout through to floating ip creation
+* Fix normalize_role_assignments() return value
+* Remove a done todo list item
+* add the ability to get an object back from swift
+* allow for updating passwords in keystone v2
+* Support neutron subnets without gateway IPs
+* Save the adminPass if returned on server create
+* Fix unit tests that validate client call arguments
+* Allow inventory filtering by cloud name
+* Add range search functionality
+
 1.4.0
 -----
 
diff --git a/PKG-INFO b/PKG-INFO
index 49614a5..4dc6ddd 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: shade
-Version: 1.4.0
+Version: 1.7.0
 Summary: Client library for operating OpenStack clouds
 Home-page: http://docs.openstack.org/infra/shade/
 Author: OpenStack Infrastructure Team
diff --git a/doc/source/usage.rst b/doc/source/usage.rst
index 43bc0d9..87269de 100644
--- a/doc/source/usage.rst
+++ b/doc/source/usage.rst
@@ -6,12 +6,18 @@ To use shade in a project::
 
 	import shade
 
-.. warning::
-  Several of the API methods return a ``dict`` that describe a resource.
-  It is possible to access keys of the dict as an attribute (e.g.,
-  ``server.id`` instead of ``server['id']``) to maintain some backward
-  compatibility, but attribute access is deprecated. New code should
-  assume a normal dictionary and access values via key.
+.. note::
+  API methods that return a description of an OpenStack resource (e.g.,
+  server instance, image, volume, etc.) do so using a dictionary of values
+  (e.g., ``server['id']``, ``image['name']``). This is the standard, and
+  **recommended**, way to access these resource values.
+
+  For backward compatibility, resource values can be accessed using object
+  attribute access (e.g., ``server.id``, ``image.name``). Shade uses the
+  `Munch library <https://github.com/Infinidat/munch>`_ to provide this
+  behavior. This is **NOT** the recommended way to access resource values.
+  We keep this behavior for developer convenience in the 1.x series of shade
+  releases. This will likely not be the case in future, major releases of shade.
 
 .. autoclass:: shade.OpenStackCloud
    :members:
diff --git a/extras/run-ansible-tests.sh b/extras/run-ansible-tests.sh
index 816eb53..a794c45 100755
--- a/extras/run-ansible-tests.sh
+++ b/extras/run-ansible-tests.sh
@@ -8,11 +8,14 @@
 #    tox -e ansible [TAG ...]
 # or
 #    tox -e ansible -- -c cloudX [TAG ...]
+# or to use the development version of Ansible:
+#    tox -e ansible -- -d -c cloudX [TAG ...]
 #
 # USAGE:
-#    run-ansible-tests.sh -e ENVDIR [-c CLOUD] [TAG ...]
+#    run-ansible-tests.sh -e ENVDIR [-d] [-c CLOUD] [TAG ...]
 #
 # PARAMETERS:
+#    -d         Use Ansible source repo development branch.
 #    -e ENVDIR  Directory of the tox environment to use for testing.
 #    -c CLOUD   Name of the cloud to use for testing.
 #               Defaults to "devstack-admin".
@@ -30,10 +33,12 @@
 
 CLOUD="devstack-admin"
 ENVDIR=
+USE_DEV=0
 
-while getopts "c:e:" opt
+while getopts "c:de:" opt
 do
     case $opt in
+    d) USE_DEV=1 ;;
     c) CLOUD=${OPTARG} ;;
     e) ENVDIR=${OPTARG} ;;
     ?) echo "Invalid option: -${OPTARG}"
@@ -50,20 +55,24 @@ fi
 shift $((OPTIND-1))
 TAGS=$( echo "$*" | tr ' ' , )
 
-if [ -d ${ENVDIR}/ansible ]
-then
-    echo "Using existing Ansible install"
-else
-    echo "Installing Ansible at $ENVDIR"
-    git clone --recursive git://github.com/ansible/ansible.git ${ENVDIR}/ansible
-fi
-
 # We need to source the current tox environment so that Ansible will
 # be setup for the correct python environment.
 source $ENVDIR/bin/activate
 
-# Setup Ansible
-source $ENVDIR/ansible/hacking/env-setup
+if [ ${USE_DEV} -eq 1 ]
+then
+    if [ -d ${ENVDIR}/ansible ]
+    then
+        echo "Using existing Ansible source repo"
+    else
+        echo "Installing Ansible source repo at $ENVDIR"
+        git clone --recursive git://github.com/ansible/ansible.git ${ENVDIR}/ansible
+    fi
+    source $ENVDIR/ansible/hacking/env-setup
+else
+    echo "Installing Ansible from pip"
+    pip install ansible
+fi
 
 # Run the shade Ansible tests
 tag_opt=""
@@ -72,4 +81,14 @@ then
     tag_opt="--tags ${TAGS}"
 fi
 
-ansible-playbook -vvv ./shade/tests/ansible/run.yml -e "cloud=${CLOUD}" ${tag_opt}
+# Until we have a module that lets us determine the image we want from
+# within a playbook, we have to find the image here and pass it in.
+# We use the openstack client instead of nova client since it can use clouds.yaml.
+IMAGE=`openstack --os-cloud=${CLOUD} image list -f value -c Name | grep -v -e ramdisk -e kernel`
+if [ $? -ne 0 ]
+then
+  echo "Failed to find Cirros image"
+  exit 1
+fi
+
+ansible-playbook -vvv ./shade/tests/ansible/run.yml -e "cloud=${CLOUD} image=${IMAGE}" ${tag_opt}
diff --git a/releasenotes/notes/add_update_service-28e590a7a7524053.yaml b/releasenotes/notes/add_update_service-28e590a7a7524053.yaml
new file mode 100644
index 0000000..ff3e7be
--- /dev/null
+++ b/releasenotes/notes/add_update_service-28e590a7a7524053.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - Add the ability to update a keystone service information. This feature is
+    not available on keystone v2.0. The new function, update_service(), allows
+    the user to update description, name of service, service type, and enabled
+    status.
diff --git a/releasenotes/notes/create_server_network_fix-c4a56b31d2850a4b.yaml b/releasenotes/notes/create_server_network_fix-c4a56b31d2850a4b.yaml
new file mode 100644
index 0000000..9f9bd54
--- /dev/null
+++ b/releasenotes/notes/create_server_network_fix-c4a56b31d2850a4b.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+  - The create_server() API call would not use the supplied 'network'
+    parameter if the 'nics' parameter was also supplied, even though it would
+    be an empty list. It now uses 'network' if 'nics' is not supplied or if
+    it is an empty list.
diff --git a/releasenotes/notes/create_service_norm-319a97433d68fa6a.yaml b/releasenotes/notes/create_service_norm-319a97433d68fa6a.yaml
new file mode 100644
index 0000000..2f6d018
--- /dev/null
+++ b/releasenotes/notes/create_service_norm-319a97433d68fa6a.yaml
@@ -0,0 +1,3 @@
+---
+fixes:
+  - The returned data from a create_service() call was not being normalized.
diff --git a/releasenotes/notes/fip_timeout-035c4bb3ff92fa1f.yaml b/releasenotes/notes/fip_timeout-035c4bb3ff92fa1f.yaml
new file mode 100644
index 0000000..2f98ebb
--- /dev/null
+++ b/releasenotes/notes/fip_timeout-035c4bb3ff92fa1f.yaml
@@ -0,0 +1,4 @@
+---
+fixes:
+  - When creating a new server, the timeout was not being passed through to
+    floating IP creation, which could also timeout.
diff --git a/releasenotes/notes/flavor_fix-a53c6b326dc34a2c.yaml b/releasenotes/notes/flavor_fix-a53c6b326dc34a2c.yaml
new file mode 100644
index 0000000..9a7ba7d
--- /dev/null
+++ b/releasenotes/notes/flavor_fix-a53c6b326dc34a2c.yaml
@@ -0,0 +1,7 @@
+---
+features:
+  - Flavors will always contain an 'extra_specs' attribute. Client cruft,
+    such as 'links', 'HUMAN_ID', etc. has been removed.
+fixes:
+  - Setting and unsetting flavor extra specs now works. This had
+    been broken since the 1.2.0 release.
diff --git a/releasenotes/notes/get_object_api-968483adb016bce1.yaml b/releasenotes/notes/get_object_api-968483adb016bce1.yaml
new file mode 100644
index 0000000..bc830d5
--- /dev/null
+++ b/releasenotes/notes/get_object_api-968483adb016bce1.yaml
@@ -0,0 +1,3 @@
+---
+features:
+  - Added a new API call, OpenStackCloud.get_object(), to download objects from swift.
diff --git a/releasenotes/notes/grant-revoke-assignments-231d3f9596a1ae75.yaml b/releasenotes/notes/grant-revoke-assignments-231d3f9596a1ae75.yaml
new file mode 100644
index 0000000..9776030
--- /dev/null
+++ b/releasenotes/notes/grant-revoke-assignments-231d3f9596a1ae75.yaml
@@ -0,0 +1,3 @@
+---
+features:
+  - add granting and revoking of roles from groups and users
diff --git a/releasenotes/notes/list-role-assignments-keystone-v2-b127b12b4860f50c.yaml b/releasenotes/notes/list-role-assignments-keystone-v2-b127b12b4860f50c.yaml
new file mode 100644
index 0000000..df0d96b
--- /dev/null
+++ b/releasenotes/notes/list-role-assignments-keystone-v2-b127b12b4860f50c.yaml
@@ -0,0 +1,3 @@
+---
+features:
+  - Implement list_role_assignments for keystone v2, using roles_for_user.
diff --git a/releasenotes/notes/net_provider-dd64b697476b7094.yaml b/releasenotes/notes/net_provider-dd64b697476b7094.yaml
new file mode 100644
index 0000000..65a0073
--- /dev/null
+++ b/releasenotes/notes/net_provider-dd64b697476b7094.yaml
@@ -0,0 +1,3 @@
+---
+features:
+  - Network provider options are now accepted in create_network().
diff --git a/releasenotes/notes/norm_role_assignments-a13f41768e62d40c.yaml b/releasenotes/notes/norm_role_assignments-a13f41768e62d40c.yaml
new file mode 100644
index 0000000..39ee276
--- /dev/null
+++ b/releasenotes/notes/norm_role_assignments-a13f41768e62d40c.yaml
@@ -0,0 +1,4 @@
+---
+fixes:
+  - Role assignments were being returned as plain dicts instead of Munch objects.
+    This has been corrected.
diff --git a/releasenotes/notes/router_ext_gw-b86582317bca8b39.yaml b/releasenotes/notes/router_ext_gw-b86582317bca8b39.yaml
new file mode 100644
index 0000000..84d9a1a
--- /dev/null
+++ b/releasenotes/notes/router_ext_gw-b86582317bca8b39.yaml
@@ -0,0 +1,4 @@
+---
+fixes:
+  - No longer fail in list_router_interfaces() if a router does
+    not have the external_gateway_info key.
diff --git a/releasenotes/notes/service_enabled_flag-c917b305d3f2e8fd.yaml b/releasenotes/notes/service_enabled_flag-c917b305d3f2e8fd.yaml
new file mode 100644
index 0000000..089d297
--- /dev/null
+++ b/releasenotes/notes/service_enabled_flag-c917b305d3f2e8fd.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+  - Keystone service descriptions were missing an attribute describing whether
+    or not the service was enabled. A new 'enabled' boolean attribute has been
+    added to the service data.
diff --git a/releasenotes/notes/swift-upload-lock-d18f3d42b3a0719a.yaml b/releasenotes/notes/swift-upload-lock-d18f3d42b3a0719a.yaml
new file mode 100644
index 0000000..27848a5
--- /dev/null
+++ b/releasenotes/notes/swift-upload-lock-d18f3d42b3a0719a.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+  - Fixed an issue where a section of code that was supposed to be resetting
+    the SwiftService object was instead resetting the protective mutex around
+    the SwiftService object leading to an exception of "__exit__"
diff --git a/releasenotes/notes/wait-on-image-snapshot-27cd2eacab2fabd8.yaml b/releasenotes/notes/wait-on-image-snapshot-27cd2eacab2fabd8.yaml
new file mode 100644
index 0000000..ae434e2
--- /dev/null
+++ b/releasenotes/notes/wait-on-image-snapshot-27cd2eacab2fabd8.yaml
@@ -0,0 +1,7 @@
+---
+features:
+  - Adds a new pair of options to create_image_snapshot(), wait and timeout,
+    to have the function wait until the image snapshot being created goes
+    into an active state.
+  - Adds a new function wait_for_image() which will wait for an image to go
+    into an active state.
diff --git a/releasenotes/notes/wait_for_server-8dc8446b7c673d36.yaml b/releasenotes/notes/wait_for_server-8dc8446b7c673d36.yaml
new file mode 100644
index 0000000..58bc54c
--- /dev/null
+++ b/releasenotes/notes/wait_for_server-8dc8446b7c673d36.yaml
@@ -0,0 +1,3 @@
+---
+features:
+  - New wait_for_server() API call to wait for a server to reach ACTIVE status.
diff --git a/setup.cfg b/setup.cfg
index f84e0dc..44ecdc3 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -31,7 +31,7 @@ all_files = 1
 upload-dir = doc/build/html
 
 [egg_info]
+tag_date = 0
 tag_build = 
 tag_svn_revision = 0
-tag_date = 0
 
diff --git a/shade.egg-info/PKG-INFO b/shade.egg-info/PKG-INFO
index 49614a5..4dc6ddd 100644
--- a/shade.egg-info/PKG-INFO
+++ b/shade.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: shade
-Version: 1.4.0
+Version: 1.7.0
 Summary: Client library for operating OpenStack clouds
 Home-page: http://docs.openstack.org/infra/shade/
 Author: OpenStack Infrastructure Team
diff --git a/shade.egg-info/SOURCES.txt b/shade.egg-info/SOURCES.txt
index fe7242f..0a09349 100644
--- a/shade.egg-info/SOURCES.txt
+++ b/shade.egg-info/SOURCES.txt
@@ -23,13 +23,28 @@ doc/source/releasenotes.rst
 doc/source/usage.rst
 extras/delete-network.sh
 extras/run-ansible-tests.sh
+releasenotes/notes/add_update_service-28e590a7a7524053.yaml
 releasenotes/notes/cache-in-use-volumes-c7fa8bb378106fe3.yaml
 releasenotes/notes/cinderv2-norm-fix-037189c60b43089f.yaml
 releasenotes/notes/create-stack-fix-12dbb59a48ac7442.yaml
+releasenotes/notes/create_server_network_fix-c4a56b31d2850a4b.yaml
+releasenotes/notes/create_service_norm-319a97433d68fa6a.yaml
 releasenotes/notes/delete-obj-return-a3ecf0415b7a2989.yaml
+releasenotes/notes/fip_timeout-035c4bb3ff92fa1f.yaml
 releasenotes/notes/fix-list-networks-a592725df64c306e.yaml
 releasenotes/notes/fix-update-domain-af47b066ac52eb7f.yaml
+releasenotes/notes/flavor_fix-a53c6b326dc34a2c.yaml
+releasenotes/notes/get_object_api-968483adb016bce1.yaml
+releasenotes/notes/grant-revoke-assignments-231d3f9596a1ae75.yaml
+releasenotes/notes/list-role-assignments-keystone-v2-b127b12b4860f50c.yaml
+releasenotes/notes/net_provider-dd64b697476b7094.yaml
+releasenotes/notes/norm_role_assignments-a13f41768e62d40c.yaml
+releasenotes/notes/router_ext_gw-b86582317bca8b39.yaml
+releasenotes/notes/service_enabled_flag-c917b305d3f2e8fd.yaml
 releasenotes/notes/started-using-reno-242e2b0cd27f9480.yaml
+releasenotes/notes/swift-upload-lock-d18f3d42b3a0719a.yaml
+releasenotes/notes/wait-on-image-snapshot-27cd2eacab2fabd8.yaml
+releasenotes/notes/wait_for_server-8dc8446b7c673d36.yaml
 shade/__init__.py
 shade/_log.py
 shade/_tasks.py
@@ -72,12 +87,15 @@ shade/tests/ansible/roles/router/tasks/main.yml
 shade/tests/ansible/roles/router/vars/main.yml
 shade/tests/ansible/roles/security_group/tasks/main.yml
 shade/tests/ansible/roles/security_group/vars/main.yml
+shade/tests/ansible/roles/server/tasks/main.yml
+shade/tests/ansible/roles/server/vars/main.yaml
 shade/tests/ansible/roles/subnet/tasks/main.yml
 shade/tests/ansible/roles/subnet/vars/main.yml
 shade/tests/ansible/roles/user/tasks/main.yml
 shade/tests/ansible/roles/user_group/tasks/main.yml
 shade/tests/ansible/roles/volume/tasks/main.yml
 shade/tests/functional/__init__.py
+shade/tests/functional/base.py
 shade/tests/functional/test_compute.py
 shade/tests/functional/test_domain.py
 shade/tests/functional/test_endpoints.py
@@ -91,6 +109,7 @@ shade/tests/functional/test_inventory.py
 shade/tests/functional/test_network.py
 shade/tests/functional/test_object.py
 shade/tests/functional/test_port.py
+shade/tests/functional/test_range_search.py
 shade/tests/functional/test_router.py
 shade/tests/functional/test_services.py
 shade/tests/functional/test_users.py
@@ -115,6 +134,8 @@ shade/tests/unit/test_floating_ip_nova.py
 shade/tests/unit/test_floating_ip_pool.py
 shade/tests/unit/test_groups.py
 shade/tests/unit/test_identity_roles.py
+shade/tests/unit/test_image.py
+shade/tests/unit/test_image_snapshot.py
 shade/tests/unit/test_inventory.py
 shade/tests/unit/test_keypair.py
 shade/tests/unit/test_meta.py
@@ -124,6 +145,7 @@ shade/tests/unit/test_operator_noauth.py
 shade/tests/unit/test_port.py
 shade/tests/unit/test_project.py
 shade/tests/unit/test_rebuild_server.py
+shade/tests/unit/test_role_assignment.py
 shade/tests/unit/test_security_groups.py
 shade/tests/unit/test_services.py
 shade/tests/unit/test_shade.py
diff --git a/shade.egg-info/pbr.json b/shade.egg-info/pbr.json
index 8434767..bd88a2d 100644
--- a/shade.egg-info/pbr.json
+++ b/shade.egg-info/pbr.json
@@ -1 +1 @@
-{"is_release": true, "git_version": "457ea84"}
\ No newline at end of file
+{"git_version": "bdeb25d", "is_release": true}
\ No newline at end of file
diff --git a/shade/_tasks.py b/shade/_tasks.py
index dffda00..f775e95 100644
--- a/shade/_tasks.py
+++ b/shade/_tasks.py
@@ -37,6 +37,11 @@ class UserUpdate(task_manager.Task):
         return client.keystone_client.users.update(**self.args)
 
 
+class UserPasswordUpdate(task_manager.Task):
+    def main(self, client):
+        return client.keystone_client.users.update_password(**self.args)
+
+
 class UserGet(task_manager.Task):
     def main(self, client):
         return client.keystone_client.users.get(**self.args)
@@ -82,6 +87,32 @@ class FlavorList(task_manager.Task):
         return client.nova_client.flavors.list(**self.args)
 
 
+class FlavorGetExtraSpecs(task_manager.RequestTask):
+    result_key = 'extra_specs'
+
+    def main(self, client):
+        return client._compute_client.get(
+            "/flavors/{id}/os-extra_specs".format(**self.args))
+
+
+class FlavorSetExtraSpecs(task_manager.RequestTask):
+    result_key = 'extra_specs'
+
+    def main(self, client):
+        return client._compute_client.post(
+            "/flavors/{id}/os-extra_specs".format(**self.args),
+            json=self.args['json']
+            )
+
+
+class FlavorUnsetExtraSpecs(task_manager.RequestTask):
+
+    def main(self, client):
+        return client._compute_client.delete(
+            "/flavors/{id}/os-extra_specs/{key}".format(**self.args),
+            )
+
+
 class FlavorCreate(task_manager.Task):
     def main(self, client):
         return client.nova_client.flavors.create(**self.args)
@@ -161,10 +192,16 @@ class KeypairDelete(task_manager.Task):
         return client.nova_client.keypairs.delete(**self.args)
 
 
-class NovaUrlGet(task_manager.Task):
+class NovaListExtensions(task_manager.RequestTask):
+    result_key = 'extensions'
+
     def main(self, client):
-        self.requests = True
-        return client.nova_client.client.get(**self.args)
+        return client._compute_client.get('/extensions')
+
+
+class NovaUrlGet(task_manager.RequestTask):
+    def main(self, client):
+        return client._compute_client.get(**self.args)
 
 
 class NetworkList(task_manager.Task):
@@ -467,6 +504,11 @@ class ObjectMetadata(task_manager.Task):
         return client.swift_client.head_object(**self.args)
 
 
+class ObjectGet(task_manager.Task):
+    def main(self, client):
+        return client.swift_client.get_object(**self.args)
+
+
 class SubnetCreate(task_manager.Task):
     def main(self, client):
         return client.neutron_client.create_subnet(**self.args)
@@ -597,6 +639,11 @@ class ServiceList(task_manager.Task):
         return client.keystone_client.services.list()
 
 
+class ServiceUpdate(task_manager.Task):
+    def main(self, client):
+        return client.keystone_client.services.update(**self.args)
+
+
 class ServiceDelete(task_manager.Task):
     def main(self, client):
         return client.keystone_client.services.delete(**self.args)
@@ -677,11 +724,36 @@ class RoleDelete(task_manager.Task):
         return client.keystone_client.roles.delete(**self.args)
 
 
+class RoleAddUser(task_manager.Task):
+    def main(self, client):
+        return client.keystone_client.roles.add_user_role(**self.args)
+
+
+class RoleGrantUser(task_manager.Task):
+    def main(self, client):
+        return client.keystone_client.roles.grant(**self.args)
+
+
+class RoleRemoveUser(task_manager.Task):
+    def main(self, client):
+        return client.keystone_client.roles.remove_user_role(**self.args)
+
+
+class RoleRevokeUser(task_manager.Task):
+    def main(self, client):
+        return client.keystone_client.roles.revoke(**self.args)
+
+
 class RoleAssignmentList(task_manager.Task):
     def main(self, client):
         return client.keystone_client.role_assignments.list(**self.args)
 
 
+class RolesForUser(task_manager.Task):
+    def main(self, client):
+        return client.keystone_client.roles.roles_for_user(**self.args)
+
+
 class StackList(task_manager.Task):
     def main(self, client):
         return client.heat_client.stacks.list()
@@ -694,4 +766,4 @@ class StackCreate(task_manager.Task):
 
 class StackDelete(task_manager.Task):
     def main(self, client):
-        return client.heat_client.stacks.delete(**self.args)
+        return client.heat_client.stacks.delete(self.args['id'])
diff --git a/shade/_utils.py b/shade/_utils.py
index ae20654..66f3138 100644
--- a/shade/_utils.py
+++ b/shade/_utils.py
@@ -14,7 +14,9 @@
 
 import contextlib
 import inspect
+import munch
 import netifaces
+import re
 import six
 import time
 
@@ -191,6 +193,7 @@ def normalize_keystone_services(services):
             'description': service.get('description', None),
             'type': service_type,
             'service_type': service_type,
+            'enabled': service['enabled']
         }
         ret.append(new_service)
     return meta.obj_list_to_dict(ret)
@@ -436,7 +439,7 @@ def normalize_role_assignments(assignments):
     """
     new_assignments = []
     for assignment in assignments:
-        new_val = {'id': assignment['role']['id']}
+        new_val = munch.Munch({'id': assignment['role']['id']})
         for scope in ('project', 'domain'):
             if scope in assignment['scope']:
                 new_val[scope] = assignment['scope'][scope]['id']
@@ -447,6 +450,44 @@ def normalize_role_assignments(assignments):
     return new_assignments
 
 
+def normalize_roles(roles):
+    """Normalize Identity roles."""
+    ret = [
+        dict(
+            id=role.get('id'),
+            name=role.get('name'),
+        ) for role in roles
+    ]
+    return meta.obj_list_to_dict(ret)
+
+
+def normalize_stacks(stacks):
+    """ Normalize Stack Object """
+    for stack in stacks:
+        stack['name'] = stack['stack_name']
+    return stacks
+
+
+def normalize_flavors(flavors):
+    """ Normalize a list of flavor objects """
+    for flavor in flavors:
+        flavor.pop('links', None)
+        flavor.pop('NAME_ATTR', None)
+        flavor.pop('HUMAN_ID', None)
+        flavor.pop('human_id', None)
+        if 'extra_specs' not in flavor:
+            flavor['extra_specs'] = {}
+        ephemeral = flavor.pop('OS-FLV-EXT-DATA:ephemeral', 0)
+        is_public = flavor.pop('os-flavor-access:is_public', True)
+        # Make sure both the extension version and a sane version are present
+        flavor['OS-FLV-EXT-DATA:ephemeral'] = ephemeral
+        flavor['ephemeral'] = ephemeral
+        flavor['os-flavor-access:is_public'] = is_public
+        flavor['is_public'] = is_public
+
+    return flavors
+
+
 def valid_kwargs(*valid_args):
     # This decorator checks if argument passed as **kwargs to a function are
     # present in valid_args.
@@ -535,3 +576,167 @@ def shade_exceptions(error_message=None):
         if error_message is None:
             error_message = str(e)
         raise exc.OpenStackCloudException(error_message)
+
+
+def safe_dict_min(key, data):
+    """Safely find the minimum for a given key in a list of dict objects.
+
+    This will find the minimum integer value for specific dictionary key
+    across a list of dictionaries. The values for the given key MUST be
+    integers, or string representations of an integer.
+
+    The dictionary key does not have to be present in all (or any)
+    of the elements/dicts within the data set.
+
+    :param string key: The dictionary key to search for the minimum value.
+    :param list data: List of dicts to use for the data set.
+
+    :returns: None if the field was not not found in any elements, or
+        the minimum value for the field otherwise.
+    """
+    min_value = None
+    for d in data:
+        if (key in d) and (d[key] is not None):
+            try:
+                val = int(d[key])
+            except ValueError:
+                raise exc.OpenStackCloudException(
+                    "Search for minimum value failed. "
+                    "Value for {key} is not an integer: {value}".format(
+                        key=key, value=d[key])
+                )
+            if (min_value is None) or (val < min_value):
+                min_value = val
+    return min_value
+
+
+def safe_dict_max(key, data):
+    """Safely find the maximum for a given key in a list of dict objects.
+
+    This will find the maximum integer value for specific dictionary key
+    across a list of dictionaries. The values for the given key MUST be
+    integers, or string representations of an integer.
+
+    The dictionary key does not have to be present in all (or any)
+    of the elements/dicts within the data set.
+
+    :param string key: The dictionary key to search for the maximum value.
+    :param list data: List of dicts to use for the data set.
+
+    :returns: None if the field was not not found in any elements, or
+        the maximum value for the field otherwise.
+    """
+    max_value = None
+    for d in data:
+        if (key in d) and (d[key] is not None):
+            try:
+                val = int(d[key])
+            except ValueError:
+                raise exc.OpenStackCloudException(
+                    "Search for maximum value failed. "
+                    "Value for {key} is not an integer: {value}".format(
+                        key=key, value=d[key])
+                )
+            if (max_value is None) or (val > max_value):
+                max_value = val
+    return max_value
+
+
+def parse_range(value):
+    """Parse a numerical range string.
+
+    Breakdown a range expression into its operater and numerical parts.
+    This expression must be a string. Valid values must be an integer string,
+    optionally preceeded by one of the following operators::
+
+        - "<"  : Less than
+        - ">"  : Greater than
+        - "<=" : Less than or equal to
+        - ">=" : Greater than or equal to
+
+    Some examples of valid values and function return values::
+
+        - "1024"  : returns (None, 1024)
+        - "<5"    : returns ("<", 5)
+        - ">=100" : returns (">=", 100)
+
+    :param string value: The range expression to be parsed.
+
+    :returns: A tuple with the operator string (or None if no operator
+        was given) and the integer value. None is returned if parsing failed.
+    """
+    if value is None:
+        return None
+
+    range_exp = re.match('(<|>|<=|>=){0,1}(\d+)$', value)
+    if range_exp is None:
+        return None
+
+    op = range_exp.group(1)
+    num = int(range_exp.group(2))
+    return (op, num)
+
+
+def range_filter(data, key, range_exp):
+    """Filter a list by a single range expression.
+
+    :param list data: List of dictionaries to be searched.
+    :param string key: Key name to search within the data set.
+    :param string range_exp: The expression describing the range of values.
+
+    :returns: A list subset of the original data set.
+    :raises: OpenStackCloudException on invalid range expressions.
+    """
+    filtered = []
+    range_exp = str(range_exp).upper()
+
+    if range_exp == "MIN":
+        key_min = safe_dict_min(key, data)
+        if key_min is None:
+            return []
+        for d in data:
+            if int(d[key]) == key_min:
+                filtered.append(d)
+        return filtered
+    elif range_exp == "MAX":
+        key_max = safe_dict_max(key, data)
+        if key_max is None:
+            return []
+        for d in data:
+            if int(d[key]) == key_max:
+                filtered.append(d)
+        return filtered
+
+    # Not looking for a min or max, so a range or exact value must
+    # have been supplied.
+    val_range = parse_range(range_exp)
+
+    # If parsing the range fails, it must be a bad value.
+    if val_range is None:
+        raise exc.OpenStackCloudException(
+            "Invalid range value: {value}".format(value=range_exp))
+
... 8008 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-shade.git



More information about the Python-modules-commits mailing list