From 2d472aea49cf1ebac7e431c7754d9fccf77728b4 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 5 Aug 2018 10:30:25 -0500 Subject: [PATCH] Rename Resource get and update to not clash with dict The next change is going to make Resource a subclass of dict so that we can return Resource objects in the shade layer. Unfortunately, the Resource base class has two methods, get and update, that conflict with standard dict method names. To keep things reviewable, just change the method names. Most consumers should not be using either of these methods directly. They are mostly there for lower-level things to use. However, they COULD be using them, so it's important to note that this is a breaking change. Change-Id: I2fedeea6e405dcbd333482c1964173ade98ca04d --- .../create/examples/resource/fake.py | 4 +- doc/source/contributor/create/resource.rst | 10 +-- doc/source/contributor/layout.rst | 2 +- openstack/_meta/_proxy_templates.py | 22 ++--- openstack/_meta/proxy.py | 9 +- openstack/baremetal/v1/chassis.py | 10 +-- openstack/baremetal/v1/driver.py | 4 +- openstack/baremetal/v1/node.py | 14 ++-- openstack/baremetal/v1/port.py | 10 +-- openstack/baremetal/v1/port_group.py | 10 +-- openstack/block_storage/v2/snapshot.py | 4 +- openstack/block_storage/v2/stats.py | 2 +- openstack/block_storage/v2/type.py | 2 +- openstack/block_storage/v2/volume.py | 4 +- openstack/clustering/v1/action.py | 2 +- openstack/clustering/v1/build_info.py | 2 +- openstack/clustering/v1/cluster.py | 6 +- openstack/clustering/v1/cluster_policy.py | 2 +- openstack/clustering/v1/event.py | 2 +- openstack/clustering/v1/node.py | 10 +-- openstack/clustering/v1/policy.py | 12 +-- openstack/clustering/v1/policy_type.py | 2 +- openstack/clustering/v1/profile.py | 12 +-- openstack/clustering/v1/profile_type.py | 2 +- openstack/clustering/v1/receiver.py | 6 +- openstack/compute/v2/extension.py | 2 +- openstack/compute/v2/flavor.py | 6 +- openstack/compute/v2/hypervisor.py | 4 +- openstack/compute/v2/image.py | 4 +- openstack/compute/v2/keypair.py | 2 +- openstack/compute/v2/limits.py | 6 +- openstack/compute/v2/server.py | 8 +- openstack/compute/v2/server_group.py | 2 +- openstack/compute/v2/server_interface.py | 4 +- openstack/compute/v2/service.py | 2 +- openstack/compute/v2/volume_attachment.py | 4 +- openstack/database/v1/flavor.py | 2 +- openstack/database/v1/instance.py | 4 +- openstack/identity/v2/extension.py | 2 +- openstack/identity/v2/role.py | 4 +- openstack/identity/v2/tenant.py | 4 +- openstack/identity/v2/user.py | 4 +- openstack/identity/v3/credential.py | 6 +- openstack/identity/v3/domain.py | 6 +- openstack/identity/v3/endpoint.py | 6 +- openstack/identity/v3/group.py | 6 +- openstack/identity/v3/policy.py | 6 +- openstack/identity/v3/project.py | 10 +-- openstack/identity/v3/region.py | 6 +- openstack/identity/v3/role.py | 4 +- openstack/identity/v3/service.py | 6 +- openstack/identity/v3/trust.py | 2 +- openstack/identity/v3/user.py | 6 +- openstack/image/v1/image.py | 4 +- openstack/image/v2/_proxy.py | 4 +- openstack/image/v2/image.py | 10 +-- openstack/image/v2/member.py | 4 +- openstack/instance_ha/v1/host.py | 4 +- openstack/instance_ha/v1/notification.py | 4 +- openstack/instance_ha/v1/segment.py | 4 +- openstack/key_manager/v1/container.py | 4 +- openstack/key_manager/v1/order.py | 4 +- openstack/key_manager/v1/secret.py | 6 +- openstack/load_balancer/v2/health_monitor.py | 4 +- openstack/load_balancer/v2/l7_policy.py | 4 +- openstack/load_balancer/v2/l7_rule.py | 4 +- openstack/load_balancer/v2/listener.py | 4 +- openstack/load_balancer/v2/load_balancer.py | 4 +- openstack/load_balancer/v2/member.py | 4 +- openstack/load_balancer/v2/pool.py | 4 +- openstack/message/v2/claim.py | 10 +-- openstack/message/v2/message.py | 4 +- openstack/message/v2/queue.py | 4 +- openstack/message/v2/subscription.py | 4 +- openstack/network/v2/_proxy.py | 4 +- openstack/network/v2/address_scope.py | 4 +- openstack/network/v2/agent.py | 10 +-- .../network/v2/auto_allocated_topology.py | 4 +- openstack/network/v2/availability_zone.py | 4 +- openstack/network/v2/extension.py | 2 +- openstack/network/v2/flavor.py | 4 +- openstack/network/v2/floating_ip.py | 4 +- openstack/network/v2/health_monitor.py | 4 +- openstack/network/v2/listener.py | 4 +- openstack/network/v2/load_balancer.py | 4 +- openstack/network/v2/metering_label.py | 4 +- openstack/network/v2/metering_label_rule.py | 4 +- openstack/network/v2/network.py | 8 +- .../network/v2/network_ip_availability.py | 4 +- openstack/network/v2/pool.py | 4 +- openstack/network/v2/pool_member.py | 4 +- openstack/network/v2/port.py | 4 +- .../network/v2/qos_bandwidth_limit_rule.py | 4 +- openstack/network/v2/qos_dscp_marking_rule.py | 4 +- .../network/v2/qos_minimum_bandwidth_rule.py | 4 +- openstack/network/v2/qos_policy.py | 4 +- openstack/network/v2/qos_rule_type.py | 4 +- openstack/network/v2/quota.py | 8 +- openstack/network/v2/rbac_policy.py | 4 +- openstack/network/v2/router.py | 6 +- openstack/network/v2/security_group.py | 4 +- openstack/network/v2/security_group_rule.py | 4 +- openstack/network/v2/segment.py | 4 +- openstack/network/v2/service_profile.py | 4 +- openstack/network/v2/service_provider.py | 4 +- openstack/network/v2/subnet.py | 4 +- openstack/network/v2/subnet_pool.py | 4 +- openstack/network/v2/trunk.py | 4 +- openstack/network/v2/vpn_service.py | 4 +- openstack/object_store/v1/_base.py | 2 +- openstack/object_store/v1/account.py | 4 +- openstack/object_store/v1/container.py | 4 +- openstack/object_store/v1/obj.py | 4 +- openstack/orchestration/v1/_proxy.py | 2 +- openstack/orchestration/v1/resource.py | 2 +- openstack/orchestration/v1/software_config.py | 4 +- .../orchestration/v1/software_deployment.py | 8 +- openstack/orchestration/v1/stack.py | 20 +++-- .../orchestration/v1/stack_environment.py | 4 +- openstack/orchestration/v1/stack_files.py | 6 +- openstack/orchestration/v1/stack_template.py | 4 +- openstack/orchestration/v1/template.py | 4 +- openstack/proxy.py | 8 +- openstack/resource.py | 62 +++++++------- .../tests/unit/baremetal/test_version.py | 6 +- .../tests/unit/baremetal/v1/test_chassis.py | 10 +-- .../tests/unit/baremetal/v1/test_driver.py | 4 +- .../tests/unit/baremetal/v1/test_node.py | 32 +++---- .../tests/unit/baremetal/v1/test_port.py | 10 +-- .../unit/baremetal/v1/test_port_group.py | 10 +-- .../unit/block_storage/v2/test_snapshot.py | 4 +- .../tests/unit/block_storage/v2/test_type.py | 4 +- .../unit/block_storage/v2/test_volume.py | 4 +- .../tests/unit/block_store/v2/test_stats.py | 4 +- .../tests/unit/clustering/test_version.py | 4 +- .../tests/unit/clustering/v1/test_action.py | 2 +- .../unit/clustering/v1/test_build_info.py | 2 +- .../tests/unit/clustering/v1/test_cluster.py | 4 +- .../unit/clustering/v1/test_cluster_policy.py | 2 +- .../tests/unit/clustering/v1/test_event.py | 2 +- .../tests/unit/clustering/v1/test_node.py | 8 +- .../tests/unit/clustering/v1/test_policy.py | 8 +- .../unit/clustering/v1/test_policy_type.py | 2 +- .../tests/unit/clustering/v1/test_profile.py | 12 +-- .../unit/clustering/v1/test_profile_type.py | 2 +- .../tests/unit/clustering/v1/test_receiver.py | 4 +- openstack/tests/unit/compute/test_version.py | 4 +- .../tests/unit/compute/v2/test_extension.py | 4 +- .../tests/unit/compute/v2/test_flavor.py | 8 +- .../tests/unit/compute/v2/test_hypervisor.py | 4 +- openstack/tests/unit/compute/v2/test_image.py | 8 +- .../tests/unit/compute/v2/test_keypair.py | 4 +- .../tests/unit/compute/v2/test_limits.py | 14 ++-- .../tests/unit/compute/v2/test_server.py | 8 +- .../unit/compute/v2/test_server_group.py | 4 +- .../unit/compute/v2/test_server_interface.py | 4 +- .../tests/unit/compute/v2/test_server_ip.py | 4 +- .../tests/unit/compute/v2/test_service.py | 4 +- .../unit/compute/v2/test_volume_attachment.py | 4 +- .../tests/unit/database/v1/test_database.py | 4 +- .../tests/unit/database/v1/test_flavor.py | 4 +- .../tests/unit/database/v1/test_instance.py | 4 +- openstack/tests/unit/database/v1/test_user.py | 4 +- openstack/tests/unit/identity/test_version.py | 4 +- .../tests/unit/identity/v2/test_extension.py | 4 +- openstack/tests/unit/identity/v2/test_role.py | 4 +- .../tests/unit/identity/v2/test_tenant.py | 4 +- openstack/tests/unit/identity/v2/test_user.py | 4 +- .../tests/unit/identity/v3/test_credential.py | 6 +- .../tests/unit/identity/v3/test_domain.py | 6 +- .../tests/unit/identity/v3/test_endpoint.py | 6 +- .../tests/unit/identity/v3/test_group.py | 6 +- .../tests/unit/identity/v3/test_policy.py | 6 +- .../tests/unit/identity/v3/test_project.py | 10 +-- .../tests/unit/identity/v3/test_region.py | 6 +- openstack/tests/unit/identity/v3/test_role.py | 4 +- .../tests/unit/identity/v3/test_service.py | 6 +- .../tests/unit/identity/v3/test_trust.py | 2 +- openstack/tests/unit/identity/v3/test_user.py | 6 +- openstack/tests/unit/image/v1/test_image.py | 4 +- openstack/tests/unit/image/v2/test_image.py | 6 +- openstack/tests/unit/image/v2/test_member.py | 4 +- openstack/tests/unit/image/v2/test_proxy.py | 6 +- .../tests/unit/instance_ha/v1/test_host.py | 4 +- .../unit/instance_ha/v1/test_notification.py | 4 +- .../tests/unit/instance_ha/v1/test_segment.py | 4 +- .../unit/key_manager/v1/test_container.py | 4 +- .../tests/unit/key_manager/v1/test_order.py | 4 +- .../tests/unit/key_manager/v1/test_secret.py | 8 +- .../unit/load_balancer/test_health_monitor.py | 4 +- .../tests/unit/load_balancer/test_l7policy.py | 4 +- .../tests/unit/load_balancer/test_l7rule.py | 4 +- .../tests/unit/load_balancer/test_listener.py | 4 +- .../unit/load_balancer/test_load_balancer.py | 4 +- .../tests/unit/load_balancer/test_member.py | 4 +- .../tests/unit/load_balancer/test_pool.py | 4 +- .../tests/unit/load_balancer/test_version.py | 4 +- openstack/tests/unit/message/test_version.py | 4 +- openstack/tests/unit/message/v2/test_claim.py | 12 +-- .../tests/unit/message/v2/test_message.py | 8 +- openstack/tests/unit/message/v2/test_queue.py | 6 +- .../unit/message/v2/test_subscription.py | 6 +- openstack/tests/unit/network/test_version.py | 4 +- .../unit/network/v2/test_address_scope.py | 4 +- openstack/tests/unit/network/v2/test_agent.py | 10 +-- .../v2/test_auto_allocated_topology.py | 4 +- .../unit/network/v2/test_availability_zone.py | 4 +- .../tests/unit/network/v2/test_extension.py | 4 +- .../tests/unit/network/v2/test_flavor.py | 4 +- .../tests/unit/network/v2/test_floating_ip.py | 4 +- .../unit/network/v2/test_health_monitor.py | 4 +- .../tests/unit/network/v2/test_listener.py | 4 +- .../unit/network/v2/test_load_balancer.py | 4 +- .../unit/network/v2/test_metering_label.py | 4 +- .../network/v2/test_metering_label_rule.py | 4 +- .../tests/unit/network/v2/test_network.py | 8 +- .../v2/test_network_ip_availability.py | 4 +- openstack/tests/unit/network/v2/test_pool.py | 4 +- .../tests/unit/network/v2/test_pool_member.py | 4 +- openstack/tests/unit/network/v2/test_port.py | 4 +- .../v2/test_qos_bandwidth_limit_rule.py | 4 +- .../network/v2/test_qos_dscp_marking_rule.py | 4 +- .../v2/test_qos_minimum_bandwidth_rule.py | 4 +- .../tests/unit/network/v2/test_qos_policy.py | 4 +- .../unit/network/v2/test_qos_rule_type.py | 4 +- openstack/tests/unit/network/v2/test_quota.py | 8 +- .../tests/unit/network/v2/test_rbac_policy.py | 4 +- .../tests/unit/network/v2/test_router.py | 6 +- .../unit/network/v2/test_security_group.py | 4 +- .../network/v2/test_security_group_rule.py | 4 +- .../tests/unit/network/v2/test_segment.py | 4 +- .../unit/network/v2/test_service_profile.py | 4 +- .../unit/network/v2/test_service_provider.py | 4 +- .../tests/unit/network/v2/test_subnet.py | 4 +- .../tests/unit/network/v2/test_subnet_pool.py | 4 +- openstack/tests/unit/network/v2/test_trunk.py | 4 +- .../tests/unit/network/v2/test_vpn_service.py | 4 +- .../unit/object_store/v1/test_account.py | 4 +- .../unit/object_store/v1/test_container.py | 12 +-- .../tests/unit/object_store/v1/test_obj.py | 4 +- .../tests/unit/orchestration/test_version.py | 4 +- .../tests/unit/orchestration/v1/test_proxy.py | 16 ++-- .../unit/orchestration/v1/test_resource.py | 2 +- .../orchestration/v1/test_software_config.py | 4 +- .../v1/test_software_deployment.py | 4 +- .../tests/unit/orchestration/v1/test_stack.py | 30 +++---- .../v1/test_stack_environment.py | 4 +- .../unit/orchestration/v1/test_stack_files.py | 6 +- .../orchestration/v1/test_stack_template.py | 4 +- .../unit/orchestration/v1/test_template.py | 4 +- openstack/tests/unit/test_proxy.py | 27 +++--- openstack/tests/unit/test_proxy_base.py | 5 +- openstack/tests/unit/test_resource.py | 84 +++++++++---------- .../tests/unit/workflow/test_execution.py | 2 +- openstack/tests/unit/workflow/test_version.py | 4 +- .../tests/unit/workflow/test_workflow.py | 2 +- openstack/workflow/v2/execution.py | 2 +- openstack/workflow/v2/workflow.py | 2 +- ...ame-resource-methods-5f2a716b08156765.yaml | 12 +++ 259 files changed, 767 insertions(+), 740 deletions(-) create mode 100644 releasenotes/notes/rename-resource-methods-5f2a716b08156765.yaml diff --git a/doc/source/contributor/create/examples/resource/fake.py b/doc/source/contributor/create/examples/resource/fake.py index 074a5fb78..d73a4f07b 100644 --- a/doc/source/contributor/create/examples/resource/fake.py +++ b/doc/source/contributor/create/examples/resource/fake.py @@ -11,8 +11,8 @@ class Fake(resource.Resource): service = fake_service.FakeService() allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True allow_head = True diff --git a/doc/source/contributor/create/resource.rst b/doc/source/contributor/create/resource.rst index d531a4717..ffe5ab3b5 100644 --- a/doc/source/contributor/create/resource.rst +++ b/doc/source/contributor/create/resource.rst @@ -130,14 +130,14 @@ value by setting it to ``True``: +----------------------------------------------+----------------+ | :class:`~openstack.resource.Resource.list` | allow_list | +----------------------------------------------+----------------+ -| :class:`~openstack.resource.Resource.get` | allow_get | +| :class:`~openstack.resource.Resource.fetch` | allow_fetch | +----------------------------------------------+----------------+ -| :class:`~openstack.resource.Resource.update` | allow_update | +| :class:`~openstack.resource.Resource.commit` | allow_commit | +----------------------------------------------+----------------+ -An additional attribute to set is ``put_update`` if your service uses ``PUT`` -requests in order to update a resource. By default, ``PATCH`` requests are -used for ``Resource.update``. +An additional attribute to set is ``commit_method``. It defaults to ``PUT``, +but some services use ``POST`` or ``PATCH`` to commit changes back to the +remote resource. Properties ---------- diff --git a/doc/source/contributor/layout.rst b/doc/source/contributor/layout.rst index 41d3ace5b..3605f7ec6 100644 --- a/doc/source/contributor/layout.rst +++ b/doc/source/contributor/layout.rst @@ -30,7 +30,7 @@ the server-side expects, as this ``prop`` becomes a mapping between the two.:: There are six additional attributes which the ``Resource`` class checks before making requests to the REST API. ``allow_create``, ``allow_retreive``, -``allow_update``, ``allow_delete``, ``allow_head``, and ``allow_list`` are set +``allow_commit``, ``allow_delete``, ``allow_head``, and ``allow_list`` are set to ``True`` or ``False``, and are checked before making the corresponding method call. diff --git a/openstack/_meta/_proxy_templates.py b/openstack/_meta/_proxy_templates.py index 610f816a7..9661a5bd3 100644 --- a/openstack/_meta/_proxy_templates.py +++ b/openstack/_meta/_proxy_templates.py @@ -57,7 +57,7 @@ _DELETE_TEMPLATE = """Delete a {resource_name} :returns: ``None`` """ -_GET_TEMPLATE = """Get a single {resource_name} +_FETCH_TEMPLATE = """Fetch a single {resource_name} :param {name}: The value can be the ID of a {name} or a @@ -78,13 +78,13 @@ _CREATE_TEMPLATE = """Create a new {resource_name} from attributes :rtype: :class:`~{resource_class}` """ -_UPDATE_TEMPLATE = """Update a {resource_name} +_COMMIT_TEMPLATE = """Commit the state of a {resource_name} :param {name}: Either the ID of a {resource_name} or a :class:`~{resource_class}` instance. :attrs kwargs: - The attributes to update on the {resource_name} represented by + The attributes to commit on the {resource_name} represented by ``{name}``. :returns: The updated server @@ -96,8 +96,8 @@ _DOC_TEMPLATES = { 'delete': _DELETE_TEMPLATE, 'find': _FIND_TEMPLATE, 'list': _LIST_TEMPLATE, - 'get': _GET_TEMPLATE, - 'update': _UPDATE_TEMPLATE, + 'fetch': _FETCH_TEMPLATE, + 'commit': _COMMIT_TEMPLATE, } _FIND_SOURCE = """ @@ -116,8 +116,8 @@ def delete(self, {name}, ignore_missing=True): self._delete(self.{resource_name}, {name}, ignore_missing=ignore_missing) """ -_GET_SOURCE = """ -def get(self, {name}): +_FETCH_SOURCE = """ +def fetch(self, {name}): return self._get(self.{resource_name}, {name}) """ @@ -127,8 +127,8 @@ def list(self, details=True, **query): return self._list(res_cls, paginated=True, **query) """ -_UPDATE_SOURCE = """ -def update(self, {name}, **attrs): +_COMMIT_SOURCE = """ +def commit(self, {name}, **attrs): return self._update(self.{resource_name}, {name}, **attrs) """ @@ -137,8 +137,8 @@ _SOURCE_TEMPLATES = { 'delete': _DELETE_SOURCE, 'find': _FIND_SOURCE, 'list': _LIST_SOURCE, - 'get': _GET_SOURCE, - 'update': _UPDATE_SOURCE, + 'fetch': _FETCH_SOURCE, + 'commit': _COMMIT_SOURCE, } diff --git a/openstack/_meta/proxy.py b/openstack/_meta/proxy.py index 0186bbd84..f96acb627 100644 --- a/openstack/_meta/proxy.py +++ b/openstack/_meta/proxy.py @@ -111,10 +111,15 @@ class ProxyMeta(type): # We pass in a copy of the dct dict so that the exec step can # be done in the context of the class the methods will be attached # to. This allows name resolution to work properly. - for action in ('create', 'get', 'update', 'delete'): + for action in ('create', 'fetch', 'commit', 'delete'): if getattr(res, 'allow_{action}'.format(action=action)): func = compile_function(dct.copy(), action, **args) - add_function(dct, func, action, args) + kwargs = {} + if action == 'fetch': + kwargs['name_template'] = 'get_{name}' + elif action == 'commit': + kwargs['name_template'] = 'update_{name}' + add_function(dct, func, action, args, **kwargs) if res.allow_list: func = compile_function(dct.copy(), 'find', **args) add_function(dct, func, 'find', args) diff --git a/openstack/baremetal/v1/chassis.py b/openstack/baremetal/v1/chassis.py index 116ea5696..32185d7cc 100644 --- a/openstack/baremetal/v1/chassis.py +++ b/openstack/baremetal/v1/chassis.py @@ -22,11 +22,11 @@ class Chassis(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'fields' @@ -54,8 +54,8 @@ class ChassisDetail(Chassis): # capabilities allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/baremetal/v1/driver.py b/openstack/baremetal/v1/driver.py index c097edbd8..5434e8259 100644 --- a/openstack/baremetal/v1/driver.py +++ b/openstack/baremetal/v1/driver.py @@ -22,8 +22,8 @@ class Driver(resource.Resource): # capabilities allow_create = False - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/baremetal/v1/node.py b/openstack/baremetal/v1/node.py index 428d8ab39..c2f82cb81 100644 --- a/openstack/baremetal/v1/node.py +++ b/openstack/baremetal/v1/node.py @@ -29,11 +29,11 @@ class Node(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'associated', 'driver', 'fields', 'provision_state', 'resource_class', @@ -267,7 +267,7 @@ class Node(resource.Resource): expected_state, timeout=timeout) else: - return self.get(session) + return self.fetch(session) def wait_for_provision_state(self, session, expected_state, timeout=None, abort_on_failed_state=True): @@ -291,7 +291,7 @@ class Node(resource.Resource): "Timeout waiting for node %(node)s to reach " "target state '%(state)s'" % {'node': self.id, 'state': expected_state}): - self.get(session) + self.fetch(session) if self._check_state_reached(session, expected_state, abort_on_failed_state): return self @@ -348,8 +348,8 @@ class NodeDetail(Node): # capabilities allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/baremetal/v1/port.py b/openstack/baremetal/v1/port.py index 99879de35..a8083d393 100644 --- a/openstack/baremetal/v1/port.py +++ b/openstack/baremetal/v1/port.py @@ -22,11 +22,11 @@ class Port(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'fields' @@ -71,8 +71,8 @@ class PortDetail(Port): # capabilities allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/baremetal/v1/port_group.py b/openstack/baremetal/v1/port_group.py index d8fda6429..3c07d70f3 100644 --- a/openstack/baremetal/v1/port_group.py +++ b/openstack/baremetal/v1/port_group.py @@ -22,11 +22,11 @@ class PortGroup(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'node', 'address', 'fields', @@ -68,8 +68,8 @@ class PortGroupDetail(PortGroup): base_path = '/portgroups/detail' allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/block_storage/v2/snapshot.py b/openstack/block_storage/v2/snapshot.py index d1080fd3f..9b5b91f66 100644 --- a/openstack/block_storage/v2/snapshot.py +++ b/openstack/block_storage/v2/snapshot.py @@ -25,10 +25,10 @@ class Snapshot(resource.Resource): 'all_tenants', 'name', 'status', 'volume_id') # capabilities - allow_get = True + allow_fetch = True allow_create = True allow_delete = True - allow_update = True + allow_commit = True allow_list = True # Properties diff --git a/openstack/block_storage/v2/stats.py b/openstack/block_storage/v2/stats.py index 914ba9436..5a3f6ae3f 100644 --- a/openstack/block_storage/v2/stats.py +++ b/openstack/block_storage/v2/stats.py @@ -21,7 +21,7 @@ class Pools(resource.Resource): service = block_storage_service.BlockStorageService() # capabilities - allow_get = False + allow_fetch = False allow_create = False allow_delete = False allow_list = True diff --git a/openstack/block_storage/v2/type.py b/openstack/block_storage/v2/type.py index 2ca9a51b0..d57d31853 100644 --- a/openstack/block_storage/v2/type.py +++ b/openstack/block_storage/v2/type.py @@ -21,7 +21,7 @@ class Type(resource.Resource): service = block_storage_service.BlockStorageService() # capabilities - allow_get = True + allow_fetch = True allow_create = True allow_delete = True allow_list = True diff --git a/openstack/block_storage/v2/volume.py b/openstack/block_storage/v2/volume.py index 25e77509f..04a05d963 100644 --- a/openstack/block_storage/v2/volume.py +++ b/openstack/block_storage/v2/volume.py @@ -25,10 +25,10 @@ class Volume(resource.Resource): 'all_tenants', 'name', 'status', 'project_id') # capabilities - allow_get = True + allow_fetch = True allow_create = True allow_delete = True - allow_update = True + allow_commit = True allow_list = True # Properties diff --git a/openstack/clustering/v1/action.py b/openstack/clustering/v1/action.py index 76a63c9b2..79c5d4edc 100644 --- a/openstack/clustering/v1/action.py +++ b/openstack/clustering/v1/action.py @@ -23,7 +23,7 @@ class Action(resource.Resource): # Capabilities allow_list = True - allow_get = True + allow_fetch = True _query_mapping = resource.QueryParameters( 'name', 'action', 'status', 'sort', 'global_project', diff --git a/openstack/clustering/v1/build_info.py b/openstack/clustering/v1/build_info.py index 901f43b5f..705f4065c 100644 --- a/openstack/clustering/v1/build_info.py +++ b/openstack/clustering/v1/build_info.py @@ -20,7 +20,7 @@ class BuildInfo(resource.Resource): service = clustering_service.ClusteringService() # Capabilities - allow_get = True + allow_fetch = True # Properties #: String representation of the API build version diff --git a/openstack/clustering/v1/cluster.py b/openstack/clustering/v1/cluster.py index be01529fa..e8ab4c969 100644 --- a/openstack/clustering/v1/cluster.py +++ b/openstack/clustering/v1/cluster.py @@ -23,11 +23,11 @@ class Cluster(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'name', 'status', 'sort', 'global_project') diff --git a/openstack/clustering/v1/cluster_policy.py b/openstack/clustering/v1/cluster_policy.py index 49c9c4c77..6e430cc5f 100644 --- a/openstack/clustering/v1/cluster_policy.py +++ b/openstack/clustering/v1/cluster_policy.py @@ -22,7 +22,7 @@ class ClusterPolicy(resource.Resource): # Capabilities allow_list = True - allow_get = True + allow_fetch = True _query_mapping = resource.QueryParameters( 'sort', 'policy_name', 'policy_type', is_enabled='enabled') diff --git a/openstack/clustering/v1/event.py b/openstack/clustering/v1/event.py index 6ca6798c3..d187fa69c 100644 --- a/openstack/clustering/v1/event.py +++ b/openstack/clustering/v1/event.py @@ -23,7 +23,7 @@ class Event(resource.Resource): # Capabilities allow_list = True - allow_get = True + allow_fetch = True _query_mapping = resource.QueryParameters( 'cluster_id', 'action', 'level', 'sort', 'global_project', diff --git a/openstack/clustering/v1/node.py b/openstack/clustering/v1/node.py index 2c3775224..655e3a959 100644 --- a/openstack/clustering/v1/node.py +++ b/openstack/clustering/v1/node.py @@ -23,12 +23,12 @@ class Node(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'show_details', 'name', 'sort', 'global_project', 'cluster_id', @@ -169,8 +169,8 @@ class NodeDetail(Node): base_path = '/nodes/%(node_id)s?show_details=True' allow_create = False - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = False allow_list = False diff --git a/openstack/clustering/v1/policy.py b/openstack/clustering/v1/policy.py index 5a1202e4f..be98984f7 100644 --- a/openstack/clustering/v1/policy.py +++ b/openstack/clustering/v1/policy.py @@ -22,12 +22,12 @@ class Policy(resource.Resource): # Capabilities allow_list = True - allow_get = True + allow_fetch = True allow_create = True allow_delete = True - allow_update = True + allow_commit = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'name', 'type', 'sort', 'global_project') @@ -58,9 +58,9 @@ class PolicyValidate(Policy): # Capabilities allow_list = False - allow_get = False + allow_fetch = False allow_create = True allow_delete = False - allow_update = False + allow_commit = False - update_method = 'PUT' + commit_method = 'PUT' diff --git a/openstack/clustering/v1/policy_type.py b/openstack/clustering/v1/policy_type.py index 6acb10000..bd2bdd490 100644 --- a/openstack/clustering/v1/policy_type.py +++ b/openstack/clustering/v1/policy_type.py @@ -22,7 +22,7 @@ class PolicyType(resource.Resource): # Capabilities allow_list = True - allow_get = True + allow_fetch = True # Properties #: Name of policy type. diff --git a/openstack/clustering/v1/profile.py b/openstack/clustering/v1/profile.py index b148a6167..77f117dde 100644 --- a/openstack/clustering/v1/profile.py +++ b/openstack/clustering/v1/profile.py @@ -22,12 +22,12 @@ class Profile(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'sort', 'global_project', 'type', 'name') @@ -56,9 +56,9 @@ class Profile(resource.Resource): class ProfileValidate(Profile): base_path = '/profiles/validate' allow_create = True - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = False - update_method = 'PUT' + commit_method = 'PUT' diff --git a/openstack/clustering/v1/profile_type.py b/openstack/clustering/v1/profile_type.py index 0f105920a..f2b7ad88f 100644 --- a/openstack/clustering/v1/profile_type.py +++ b/openstack/clustering/v1/profile_type.py @@ -23,7 +23,7 @@ class ProfileType(resource.Resource): # Capabilities allow_list = True - allow_get = True + allow_fetch = True # Properties #: Name of the profile type. diff --git a/openstack/clustering/v1/receiver.py b/openstack/clustering/v1/receiver.py index 434244d75..d42d7a48d 100644 --- a/openstack/clustering/v1/receiver.py +++ b/openstack/clustering/v1/receiver.py @@ -22,12 +22,12 @@ class Receiver(resource.Resource): # Capabilities allow_list = True - allow_get = True + allow_fetch = True allow_create = True - allow_update = True + allow_commit = True allow_delete = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'name', 'type', 'cluster_id', 'action', 'sort', 'global_project', diff --git a/openstack/compute/v2/extension.py b/openstack/compute/v2/extension.py index c5a938bf5..a12f22efb 100644 --- a/openstack/compute/v2/extension.py +++ b/openstack/compute/v2/extension.py @@ -22,7 +22,7 @@ class Extension(resource.Resource): id_attribute = "alias" # capabilities - allow_get = True + allow_fetch = True allow_list = True # Properties diff --git a/openstack/compute/v2/flavor.py b/openstack/compute/v2/flavor.py index abdc08df6..14920403a 100644 --- a/openstack/compute/v2/flavor.py +++ b/openstack/compute/v2/flavor.py @@ -22,7 +22,7 @@ class Flavor(resource.Resource): # capabilities allow_create = True - allow_get = True + allow_fetch = True allow_delete = True allow_list = True @@ -62,8 +62,8 @@ class FlavorDetail(Flavor): base_path = '/flavors/detail' allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/compute/v2/hypervisor.py b/openstack/compute/v2/hypervisor.py index e28cb095a..2f49f5a3c 100644 --- a/openstack/compute/v2/hypervisor.py +++ b/openstack/compute/v2/hypervisor.py @@ -23,7 +23,7 @@ class Hypervisor(resource.Resource): service = compute_service.ComputeService() # capabilities - allow_get = True + allow_fetch = True allow_list = True # Properties @@ -71,5 +71,5 @@ class HypervisorDetail(Hypervisor): base_path = '/os-hypervisors/detail' # capabilities - allow_get = False + allow_fetch = False allow_list = True diff --git a/openstack/compute/v2/image.py b/openstack/compute/v2/image.py index b201ac922..44c037a68 100644 --- a/openstack/compute/v2/image.py +++ b/openstack/compute/v2/image.py @@ -22,7 +22,7 @@ class Image(resource.Resource, metadata.MetadataMixin): service = compute_service.ComputeService() # capabilities - allow_get = True + allow_fetch = True allow_delete = True allow_list = True @@ -60,6 +60,6 @@ class Image(resource.Resource, metadata.MetadataMixin): class ImageDetail(Image): base_path = '/images/detail' - allow_get = False + allow_fetch = False allow_delete = False allow_list = True diff --git a/openstack/compute/v2/keypair.py b/openstack/compute/v2/keypair.py index 268de02cc..a1fb16e16 100644 --- a/openstack/compute/v2/keypair.py +++ b/openstack/compute/v2/keypair.py @@ -22,7 +22,7 @@ class Keypair(resource.Resource): # capabilities allow_create = True - allow_get = True + allow_fetch = True allow_delete = True allow_list = True diff --git a/openstack/compute/v2/limits.py b/openstack/compute/v2/limits.py index 090f312ac..1dc92bb15 100644 --- a/openstack/compute/v2/limits.py +++ b/openstack/compute/v2/limits.py @@ -73,12 +73,12 @@ class Limits(resource.Resource): resource_key = "limits" service = compute_service.ComputeService() - allow_get = True + allow_fetch = True absolute = resource.Body("absolute", type=AbsoluteLimits) rate = resource.Body("rate", type=list, list_type=RateLimit) - def get(self, session, requires_id=False, error_message=None): + def fetch(self, session, requires_id=False, error_message=None): """Get the Limits resource. :param session: The session to use for making this request. @@ -89,5 +89,5 @@ class Limits(resource.Resource): """ # TODO(mordred) We shouldn't have to subclass just to declare # requires_id = False. - return super(Limits, self).get( + return super(Limits, self).fetch( session=session, requires_id=False, error_message=error_message) diff --git a/openstack/compute/v2/server.py b/openstack/compute/v2/server.py index 30e39fe36..f1b14771f 100644 --- a/openstack/compute/v2/server.py +++ b/openstack/compute/v2/server.py @@ -24,8 +24,8 @@ class Server(resource.Resource, metadata.MetadataMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True @@ -445,8 +445,8 @@ class ServerDetail(Server): # capabilities allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/compute/v2/server_group.py b/openstack/compute/v2/server_group.py index 1807069c5..18a211358 100644 --- a/openstack/compute/v2/server_group.py +++ b/openstack/compute/v2/server_group.py @@ -24,7 +24,7 @@ class ServerGroup(resource.Resource): # capabilities allow_create = True - allow_get = True + allow_fetch = True allow_delete = True allow_list = True diff --git a/openstack/compute/v2/server_interface.py b/openstack/compute/v2/server_interface.py index 98659d9a1..0a2750fc2 100644 --- a/openstack/compute/v2/server_interface.py +++ b/openstack/compute/v2/server_interface.py @@ -22,8 +22,8 @@ class ServerInterface(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = True allow_list = True diff --git a/openstack/compute/v2/service.py b/openstack/compute/v2/service.py index 4e9b0873e..78d0735c6 100644 --- a/openstack/compute/v2/service.py +++ b/openstack/compute/v2/service.py @@ -24,7 +24,7 @@ class Service(resource.Resource): # capabilities allow_list = True - allow_update = True + allow_commit = True # Properties #: Status of service diff --git a/openstack/compute/v2/volume_attachment.py b/openstack/compute/v2/volume_attachment.py index aa3e20674..982ae42b0 100644 --- a/openstack/compute/v2/volume_attachment.py +++ b/openstack/compute/v2/volume_attachment.py @@ -22,8 +22,8 @@ class VolumeAttachment(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = True allow_list = True diff --git a/openstack/database/v1/flavor.py b/openstack/database/v1/flavor.py index ac4bf7b9d..10f78e3cc 100644 --- a/openstack/database/v1/flavor.py +++ b/openstack/database/v1/flavor.py @@ -22,7 +22,7 @@ class Flavor(resource.Resource): # capabilities allow_list = True - allow_get = True + allow_fetch = True # Properties #: Links associated with the flavor diff --git a/openstack/database/v1/instance.py b/openstack/database/v1/instance.py index 76f67b035..b0b8424c6 100644 --- a/openstack/database/v1/instance.py +++ b/openstack/database/v1/instance.py @@ -23,8 +23,8 @@ class Instance(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/identity/v2/extension.py b/openstack/identity/v2/extension.py index 0012831e6..7f05fb747 100644 --- a/openstack/identity/v2/extension.py +++ b/openstack/identity/v2/extension.py @@ -22,7 +22,7 @@ class Extension(resource.Resource): # capabilities allow_list = True - allow_get = True + allow_fetch = True # Properties #: A unique identifier, which will be used for accessing the extension diff --git a/openstack/identity/v2/role.py b/openstack/identity/v2/role.py index be07ff7fb..625c1413b 100644 --- a/openstack/identity/v2/role.py +++ b/openstack/identity/v2/role.py @@ -23,8 +23,8 @@ class Role(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/identity/v2/tenant.py b/openstack/identity/v2/tenant.py index ccac50aee..66a54aad5 100644 --- a/openstack/identity/v2/tenant.py +++ b/openstack/identity/v2/tenant.py @@ -22,8 +22,8 @@ class Tenant(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/identity/v2/user.py b/openstack/identity/v2/user.py index 3f905712c..a8f219e92 100644 --- a/openstack/identity/v2/user.py +++ b/openstack/identity/v2/user.py @@ -22,8 +22,8 @@ class User(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/identity/v3/credential.py b/openstack/identity/v3/credential.py index 781397964..2b2bf0c0b 100644 --- a/openstack/identity/v3/credential.py +++ b/openstack/identity/v3/credential.py @@ -22,11 +22,11 @@ class Credential(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'type', 'user_id', diff --git a/openstack/identity/v3/domain.py b/openstack/identity/v3/domain.py index 7ce373499..6c32a5c4c 100644 --- a/openstack/identity/v3/domain.py +++ b/openstack/identity/v3/domain.py @@ -23,11 +23,11 @@ class Domain(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'name', diff --git a/openstack/identity/v3/endpoint.py b/openstack/identity/v3/endpoint.py index e68517a04..841f5c59a 100644 --- a/openstack/identity/v3/endpoint.py +++ b/openstack/identity/v3/endpoint.py @@ -22,11 +22,11 @@ class Endpoint(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'interface', 'service_id', diff --git a/openstack/identity/v3/group.py b/openstack/identity/v3/group.py index d0d132ec0..acf763006 100644 --- a/openstack/identity/v3/group.py +++ b/openstack/identity/v3/group.py @@ -22,11 +22,11 @@ class Group(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'domain_id', 'name', diff --git a/openstack/identity/v3/policy.py b/openstack/identity/v3/policy.py index 6d240d8a2..a4a6f7cfd 100644 --- a/openstack/identity/v3/policy.py +++ b/openstack/identity/v3/policy.py @@ -22,11 +22,11 @@ class Policy(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' # Properties #: The policy rule set itself, as a serialized blob. *Type: string* diff --git a/openstack/identity/v3/project.py b/openstack/identity/v3/project.py index 12ddbd82c..56ee7dab2 100644 --- a/openstack/identity/v3/project.py +++ b/openstack/identity/v3/project.py @@ -23,11 +23,11 @@ class Project(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'domain_id', @@ -123,7 +123,7 @@ class UserProject(Project): # capabilities allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/identity/v3/region.py b/openstack/identity/v3/region.py index d774aaa17..fc0e44e73 100644 --- a/openstack/identity/v3/region.py +++ b/openstack/identity/v3/region.py @@ -22,11 +22,11 @@ class Region(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'parent_region_id', diff --git a/openstack/identity/v3/role.py b/openstack/identity/v3/role.py index aad9bdc17..e4a191fde 100644 --- a/openstack/identity/v3/role.py +++ b/openstack/identity/v3/role.py @@ -22,8 +22,8 @@ class Role(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/identity/v3/service.py b/openstack/identity/v3/service.py index 51bb7ced4..6445fb759 100644 --- a/openstack/identity/v3/service.py +++ b/openstack/identity/v3/service.py @@ -22,11 +22,11 @@ class Service(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'type', diff --git a/openstack/identity/v3/trust.py b/openstack/identity/v3/trust.py index 1b334bb02..07985f1b4 100644 --- a/openstack/identity/v3/trust.py +++ b/openstack/identity/v3/trust.py @@ -23,7 +23,7 @@ class Trust(resource.Resource): # capabilities allow_create = True - allow_get = True + allow_fetch = True allow_delete = True allow_list = True diff --git a/openstack/identity/v3/user.py b/openstack/identity/v3/user.py index bed77fb5f..bf1b34615 100644 --- a/openstack/identity/v3/user.py +++ b/openstack/identity/v3/user.py @@ -22,11 +22,11 @@ class User(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( 'domain_id', diff --git a/openstack/image/v1/image.py b/openstack/image/v1/image.py index b5b10fa1d..3f93a51df 100644 --- a/openstack/image/v1/image.py +++ b/openstack/image/v1/image.py @@ -22,8 +22,8 @@ class Image(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/image/v2/_proxy.py b/openstack/image/v2/_proxy.py index 239c543e8..3a689d991 100644 --- a/openstack/image/v2/_proxy.py +++ b/openstack/image/v2/_proxy.py @@ -157,8 +157,8 @@ class Proxy(proxy.Proxy): :returns: The updated image :rtype: :class:`~openstack.image.v2.image.Image` """ - img = self._get_resource(_image.Image, image) - return img.update(self, **attrs) + res = self._get_resource(_image.Image, image) + return res.commit(self, **attrs) def deactivate_image(self, image): """Deactivate an image diff --git a/openstack/image/v2/image.py b/openstack/image/v2/image.py index 376d96748..42f54e23c 100644 --- a/openstack/image/v2/image.py +++ b/openstack/image/v2/image.py @@ -31,11 +31,11 @@ class Image(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True - update_method = 'PATCH' + commit_method = 'PATCH' _query_mapping = resource.QueryParameters( "name", "visibility", @@ -272,7 +272,7 @@ class Image(resource.Resource): # If we don't receive the Content-MD5 header with the download, # make an additional call to get the image details and look at # the checksum attribute. - details = self.get(session) + details = self.fetch(session) checksum = details.checksum # if we are returning the repsonse object, ensure that it @@ -294,7 +294,7 @@ class Image(resource.Resource): return resp.content - def update(self, session, **attrs): + def commit(self, session, **attrs): url = utils.urljoin(self.base_path, self.id) headers = { 'Content-Type': 'application/openstack-images-v2.1-json-patch', diff --git a/openstack/image/v2/member.py b/openstack/image/v2/member.py index 4157646e0..6d565b447 100644 --- a/openstack/image/v2/member.py +++ b/openstack/image/v2/member.py @@ -21,8 +21,8 @@ class Member(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/instance_ha/v1/host.py b/openstack/instance_ha/v1/host.py index 63cc681f1..a6d9a0142 100644 --- a/openstack/instance_ha/v1/host.py +++ b/openstack/instance_ha/v1/host.py @@ -29,9 +29,9 @@ class Host(resource.Resource): # 4] PUT /v1/segments//hosts # 5] DELETE /v1/segments//hosts allow_list = True - allow_get = True + allow_fetch = True allow_create = True - allow_update = True + allow_commit = True allow_delete = True # Properties diff --git a/openstack/instance_ha/v1/notification.py b/openstack/instance_ha/v1/notification.py index ae58e699a..45f1a2e27 100644 --- a/openstack/instance_ha/v1/notification.py +++ b/openstack/instance_ha/v1/notification.py @@ -27,9 +27,9 @@ class Notification(resource.Resource): # 2] GET /v1/notifications/ # 3] POST /v1/notifications allow_list = True - allow_get = True + allow_fetch = True allow_create = True - allow_update = False + allow_commit = False allow_delete = False # Properties diff --git a/openstack/instance_ha/v1/segment.py b/openstack/instance_ha/v1/segment.py index ee9bd43bf..eec2c6c13 100644 --- a/openstack/instance_ha/v1/segment.py +++ b/openstack/instance_ha/v1/segment.py @@ -29,9 +29,9 @@ class Segment(resource.Resource): # 4] PUT /v1/segments/ # 5] DELETE /v1/segments/ allow_list = True - allow_get = True + allow_fetch = True allow_create = True - allow_update = True + allow_commit = True allow_delete = True # Properties diff --git a/openstack/key_manager/v1/container.py b/openstack/key_manager/v1/container.py index 5cc4ff1a0..e5b2629c6 100644 --- a/openstack/key_manager/v1/container.py +++ b/openstack/key_manager/v1/container.py @@ -22,8 +22,8 @@ class Container(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/key_manager/v1/order.py b/openstack/key_manager/v1/order.py index a701275d5..fec0592f2 100644 --- a/openstack/key_manager/v1/order.py +++ b/openstack/key_manager/v1/order.py @@ -22,8 +22,8 @@ class Order(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/key_manager/v1/secret.py b/openstack/key_manager/v1/secret.py index 60d95f4d1..2ba4ab552 100644 --- a/openstack/key_manager/v1/secret.py +++ b/openstack/key_manager/v1/secret.py @@ -23,8 +23,8 @@ class Secret(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True @@ -79,7 +79,7 @@ class Secret(resource.Resource): #: (required if payload is encoded) payload_content_encoding = resource.Body('payload_content_encoding') - def get(self, session, requires_id=True, error_message=None): + def fetch(self, session, requires_id=True, error_message=None): request = self._prepare_request(requires_id=requires_id) response = session.get(request.url).json() diff --git a/openstack/load_balancer/v2/health_monitor.py b/openstack/load_balancer/v2/health_monitor.py index d06de09a0..aca7fcb5d 100644 --- a/openstack/load_balancer/v2/health_monitor.py +++ b/openstack/load_balancer/v2/health_monitor.py @@ -23,9 +23,9 @@ class HealthMonitor(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True - allow_update = True + allow_commit = True _query_mapping = resource.QueryParameters( 'name', 'created_at', 'updated_at', 'delay', 'expected_codes', diff --git a/openstack/load_balancer/v2/l7_policy.py b/openstack/load_balancer/v2/l7_policy.py index 6d41d595b..37e434a69 100644 --- a/openstack/load_balancer/v2/l7_policy.py +++ b/openstack/load_balancer/v2/l7_policy.py @@ -23,8 +23,8 @@ class L7Policy(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True _query_mapping = resource.QueryParameters( diff --git a/openstack/load_balancer/v2/l7_rule.py b/openstack/load_balancer/v2/l7_rule.py index 398e31d24..cc2aa4364 100644 --- a/openstack/load_balancer/v2/l7_rule.py +++ b/openstack/load_balancer/v2/l7_rule.py @@ -23,8 +23,8 @@ class L7Rule(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True _query_mapping = resource.QueryParameters( diff --git a/openstack/load_balancer/v2/listener.py b/openstack/load_balancer/v2/listener.py index 0738466d6..6597c8998 100644 --- a/openstack/load_balancer/v2/listener.py +++ b/openstack/load_balancer/v2/listener.py @@ -22,8 +22,8 @@ class Listener(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/load_balancer/v2/load_balancer.py b/openstack/load_balancer/v2/load_balancer.py index e1b9fe579..a3ce64999 100644 --- a/openstack/load_balancer/v2/load_balancer.py +++ b/openstack/load_balancer/v2/load_balancer.py @@ -22,8 +22,8 @@ class LoadBalancer(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/load_balancer/v2/member.py b/openstack/load_balancer/v2/member.py index 1e6d0fc23..ac65eb268 100644 --- a/openstack/load_balancer/v2/member.py +++ b/openstack/load_balancer/v2/member.py @@ -22,8 +22,8 @@ class Member(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/load_balancer/v2/pool.py b/openstack/load_balancer/v2/pool.py index 305299c56..1868d208c 100644 --- a/openstack/load_balancer/v2/pool.py +++ b/openstack/load_balancer/v2/pool.py @@ -23,9 +23,9 @@ class Pool(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True - allow_update = True + allow_commit = True _query_mapping = resource.QueryParameters( 'health_monitor_id', 'lb_algorithm', 'listener_id', 'loadbalancer_id', diff --git a/openstack/message/v2/claim.py b/openstack/message/v2/claim.py index c032eaae6..51c1c0a14 100644 --- a/openstack/message/v2/claim.py +++ b/openstack/message/v2/claim.py @@ -28,10 +28,10 @@ class Claim(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True - update_method = 'PATCH' + commit_method = 'PATCH' # Properties #: The value in seconds indicating how long the claim has existed. @@ -82,7 +82,7 @@ class Claim(resource.Resource): return self - def get(self, session, requires_id=True, error_message=None): + def fetch(self, session, requires_id=True, error_message=None): request = self._prepare_request(requires_id=requires_id) headers = { "Client-ID": self.client_id or str(uuid.uuid4()), @@ -96,7 +96,7 @@ class Claim(resource.Resource): return self - def update(self, session, prepend_key=False, has_body=False): + def commit(self, session, prepend_key=False, has_body=False): request = self._prepare_request(prepend_key=prepend_key) headers = { "Client-ID": self.client_id or str(uuid.uuid4()), diff --git a/openstack/message/v2/message.py b/openstack/message/v2/message.py index b496d7786..d85f5d2b5 100644 --- a/openstack/message/v2/message.py +++ b/openstack/message/v2/message.py @@ -29,7 +29,7 @@ class Message(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True _query_mapping = resource.QueryParameters("echo", "include_claimed") @@ -109,7 +109,7 @@ class Message(resource.Resource): query_params["limit"] = yielded query_params["marker"] = new_marker - def get(self, session, requires_id=True, error_message=None): + def fetch(self, session, requires_id=True, error_message=None): request = self._prepare_request(requires_id=requires_id) headers = { "Client-ID": self.client_id or str(uuid.uuid4()), diff --git a/openstack/message/v2/queue.py b/openstack/message/v2/queue.py index 4f7087cad..2da9e87c9 100644 --- a/openstack/message/v2/queue.py +++ b/openstack/message/v2/queue.py @@ -29,7 +29,7 @@ class Queue(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True # Properties @@ -107,7 +107,7 @@ class Queue(resource.Resource): query_params["limit"] = yielded query_params["marker"] = new_marker - def get(self, session, requires_id=True, error_message=None): + def fetch(self, session, requires_id=True, error_message=None): request = self._prepare_request(requires_id=requires_id) headers = { "Client-ID": self.client_id or str(uuid.uuid4()), diff --git a/openstack/message/v2/subscription.py b/openstack/message/v2/subscription.py index 6dcf9d540..2bd779711 100644 --- a/openstack/message/v2/subscription.py +++ b/openstack/message/v2/subscription.py @@ -29,7 +29,7 @@ class Subscription(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True # Properties @@ -115,7 +115,7 @@ class Subscription(resource.Resource): query_params["limit"] = yielded query_params["marker"] = new_marker - def get(self, session, requires_id=True, error_message=None): + def fetch(self, session, requires_id=True, error_message=None): request = self._prepare_request(requires_id=requires_id) headers = { "Client-ID": self.client_id or str(uuid.uuid4()), diff --git a/openstack/network/v2/_proxy.py b/openstack/network/v2/_proxy.py index f61335af7..24a0c9f1a 100644 --- a/openstack/network/v2/_proxy.py +++ b/openstack/network/v2/_proxy.py @@ -1538,11 +1538,11 @@ class Proxy(proxy.Proxy): def add_ip_to_port(self, port, ip): ip.port_id = port.id - return ip.update(self) + return ip.commit(self) def remove_ip_from_port(self, ip): ip.port_id = None - return ip.update(self) + return ip.commit(self) def get_subnet_ports(self, subnet_id): result = [] diff --git a/openstack/network/v2/address_scope.py b/openstack/network/v2/address_scope.py index 501800cb2..326cf2035 100644 --- a/openstack/network/v2/address_scope.py +++ b/openstack/network/v2/address_scope.py @@ -23,8 +23,8 @@ class AddressScope(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/agent.py b/openstack/network/v2/agent.py index c657bfc8b..6df7af057 100644 --- a/openstack/network/v2/agent.py +++ b/openstack/network/v2/agent.py @@ -24,8 +24,8 @@ class Agent(resource.Resource): # capabilities allow_create = False - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True @@ -100,8 +100,8 @@ class NetworkHostingDHCPAgent(Agent): # capabilities allow_create = False - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = False allow_list = True @@ -118,7 +118,7 @@ class RouterL3Agent(Agent): # capabilities allow_create = False allow_retrieve = True - allow_update = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/network/v2/auto_allocated_topology.py b/openstack/network/v2/auto_allocated_topology.py index 917de9780..98b2d9fbe 100644 --- a/openstack/network/v2/auto_allocated_topology.py +++ b/openstack/network/v2/auto_allocated_topology.py @@ -22,8 +22,8 @@ class AutoAllocatedTopology(resource.Resource): # Capabilities allow_create = False - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = True allow_list = False diff --git a/openstack/network/v2/availability_zone.py b/openstack/network/v2/availability_zone.py index 7bc1a8d04..295ac42ac 100644 --- a/openstack/network/v2/availability_zone.py +++ b/openstack/network/v2/availability_zone.py @@ -22,8 +22,8 @@ class AvailabilityZone(_resource.Resource): # capabilities allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/network/v2/extension.py b/openstack/network/v2/extension.py index 50fc4371f..d13c806b2 100644 --- a/openstack/network/v2/extension.py +++ b/openstack/network/v2/extension.py @@ -21,7 +21,7 @@ class Extension(resource.Resource): service = network_service.NetworkService() # capabilities - allow_get = True + allow_fetch = True allow_list = True # NOTE: No query parameters supported diff --git a/openstack/network/v2/flavor.py b/openstack/network/v2/flavor.py index 0947f5677..cb7f0c1eb 100644 --- a/openstack/network/v2/flavor.py +++ b/openstack/network/v2/flavor.py @@ -23,8 +23,8 @@ class Flavor(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/floating_ip.py b/openstack/network/v2/floating_ip.py index e562856b0..dcde09905 100644 --- a/openstack/network/v2/floating_ip.py +++ b/openstack/network/v2/floating_ip.py @@ -25,8 +25,8 @@ class FloatingIP(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/health_monitor.py b/openstack/network/v2/health_monitor.py index 4430b3009..6ed64bf05 100644 --- a/openstack/network/v2/health_monitor.py +++ b/openstack/network/v2/health_monitor.py @@ -22,8 +22,8 @@ class HealthMonitor(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/listener.py b/openstack/network/v2/listener.py index b947cc171..e90398577 100644 --- a/openstack/network/v2/listener.py +++ b/openstack/network/v2/listener.py @@ -22,8 +22,8 @@ class Listener(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/load_balancer.py b/openstack/network/v2/load_balancer.py index 29cedd299..6f66b752d 100644 --- a/openstack/network/v2/load_balancer.py +++ b/openstack/network/v2/load_balancer.py @@ -22,8 +22,8 @@ class LoadBalancer(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/metering_label.py b/openstack/network/v2/metering_label.py index 5d9cccf38..90a62781b 100644 --- a/openstack/network/v2/metering_label.py +++ b/openstack/network/v2/metering_label.py @@ -22,8 +22,8 @@ class MeteringLabel(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/metering_label_rule.py b/openstack/network/v2/metering_label_rule.py index e6db81fd5..eb766c8de 100644 --- a/openstack/network/v2/metering_label_rule.py +++ b/openstack/network/v2/metering_label_rule.py @@ -22,8 +22,8 @@ class MeteringLabelRule(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/network.py b/openstack/network/v2/network.py index f9067e57b..5b706375a 100644 --- a/openstack/network/v2/network.py +++ b/openstack/network/v2/network.py @@ -23,8 +23,8 @@ class Network(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True @@ -125,8 +125,8 @@ class DHCPAgentHostingNetwork(Network): # capabilities allow_create = False - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/network/v2/network_ip_availability.py b/openstack/network/v2/network_ip_availability.py index f9e136211..ce2c372b7 100644 --- a/openstack/network/v2/network_ip_availability.py +++ b/openstack/network/v2/network_ip_availability.py @@ -23,8 +23,8 @@ class NetworkIPAvailability(resource.Resource): # capabilities allow_create = False - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/network/v2/pool.py b/openstack/network/v2/pool.py index cecba0072..671610087 100644 --- a/openstack/network/v2/pool.py +++ b/openstack/network/v2/pool.py @@ -22,8 +22,8 @@ class Pool(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/pool_member.py b/openstack/network/v2/pool_member.py index 2de93f951..c75e0c3bb 100644 --- a/openstack/network/v2/pool_member.py +++ b/openstack/network/v2/pool_member.py @@ -22,8 +22,8 @@ class PoolMember(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/port.py b/openstack/network/v2/port.py index 64d034aeb..625464713 100644 --- a/openstack/network/v2/port.py +++ b/openstack/network/v2/port.py @@ -23,8 +23,8 @@ class Port(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/qos_bandwidth_limit_rule.py b/openstack/network/v2/qos_bandwidth_limit_rule.py index f080938ec..1f289ebb6 100644 --- a/openstack/network/v2/qos_bandwidth_limit_rule.py +++ b/openstack/network/v2/qos_bandwidth_limit_rule.py @@ -22,8 +22,8 @@ class QoSBandwidthLimitRule(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/qos_dscp_marking_rule.py b/openstack/network/v2/qos_dscp_marking_rule.py index bf247f1e1..9333d9813 100644 --- a/openstack/network/v2/qos_dscp_marking_rule.py +++ b/openstack/network/v2/qos_dscp_marking_rule.py @@ -22,8 +22,8 @@ class QoSDSCPMarkingRule(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/qos_minimum_bandwidth_rule.py b/openstack/network/v2/qos_minimum_bandwidth_rule.py index ad773d5d8..476079570 100644 --- a/openstack/network/v2/qos_minimum_bandwidth_rule.py +++ b/openstack/network/v2/qos_minimum_bandwidth_rule.py @@ -22,8 +22,8 @@ class QoSMinimumBandwidthRule(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/qos_policy.py b/openstack/network/v2/qos_policy.py index b425ab7b3..941132899 100644 --- a/openstack/network/v2/qos_policy.py +++ b/openstack/network/v2/qos_policy.py @@ -24,8 +24,8 @@ class QoSPolicy(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/qos_rule_type.py b/openstack/network/v2/qos_rule_type.py index a241615ea..a917af2a1 100644 --- a/openstack/network/v2/qos_rule_type.py +++ b/openstack/network/v2/qos_rule_type.py @@ -22,8 +22,8 @@ class QoSRuleType(resource.Resource): # capabilities allow_create = False - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/network/v2/quota.py b/openstack/network/v2/quota.py index fadaff1b0..fbed68f5f 100644 --- a/openstack/network/v2/quota.py +++ b/openstack/network/v2/quota.py @@ -21,8 +21,8 @@ class Quota(resource.Resource): service = network_service.NetworkService() # capabilities - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True @@ -75,7 +75,7 @@ class QuotaDefault(Quota): # capabilities allow_retrieve = True - allow_update = False + allow_commit = False allow_delete = False allow_list = False @@ -89,7 +89,7 @@ class QuotaDetails(Quota): # capabilities allow_retrieve = True - allow_update = False + allow_commit = False allow_delete = False allow_list = False diff --git a/openstack/network/v2/rbac_policy.py b/openstack/network/v2/rbac_policy.py index e0262ab77..4043f0e44 100644 --- a/openstack/network/v2/rbac_policy.py +++ b/openstack/network/v2/rbac_policy.py @@ -22,8 +22,8 @@ class RBACPolicy(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/router.py b/openstack/network/v2/router.py index d2f950cca..71cb19495 100644 --- a/openstack/network/v2/router.py +++ b/openstack/network/v2/router.py @@ -24,8 +24,8 @@ class Router(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True @@ -142,7 +142,7 @@ class L3AgentRouter(Router): # capabilities allow_create = False allow_retrieve = True - allow_update = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/network/v2/security_group.py b/openstack/network/v2/security_group.py index 6a87eabc5..2ec91d5a1 100644 --- a/openstack/network/v2/security_group.py +++ b/openstack/network/v2/security_group.py @@ -23,8 +23,8 @@ class SecurityGroup(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/security_group_rule.py b/openstack/network/v2/security_group_rule.py index 6bbf0d672..286a7adc7 100644 --- a/openstack/network/v2/security_group_rule.py +++ b/openstack/network/v2/security_group_rule.py @@ -22,8 +22,8 @@ class SecurityGroupRule(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = False + allow_fetch = True + allow_commit = False allow_delete = True allow_list = True diff --git a/openstack/network/v2/segment.py b/openstack/network/v2/segment.py index c81f21049..808d08cdb 100644 --- a/openstack/network/v2/segment.py +++ b/openstack/network/v2/segment.py @@ -22,8 +22,8 @@ class Segment(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/service_profile.py b/openstack/network/v2/service_profile.py index 2707e0ac9..4b999ef8c 100644 --- a/openstack/network/v2/service_profile.py +++ b/openstack/network/v2/service_profile.py @@ -22,8 +22,8 @@ class ServiceProfile(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/service_provider.py b/openstack/network/v2/service_provider.py index d6d93d2fc..9f0ec773a 100644 --- a/openstack/network/v2/service_provider.py +++ b/openstack/network/v2/service_provider.py @@ -21,8 +21,8 @@ class ServiceProvider(resource.Resource): # Capabilities allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_list = True diff --git a/openstack/network/v2/subnet.py b/openstack/network/v2/subnet.py index 47c58afb2..e611d0b6a 100644 --- a/openstack/network/v2/subnet.py +++ b/openstack/network/v2/subnet.py @@ -23,8 +23,8 @@ class Subnet(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/subnet_pool.py b/openstack/network/v2/subnet_pool.py index 593cda01e..a8648fdf3 100644 --- a/openstack/network/v2/subnet_pool.py +++ b/openstack/network/v2/subnet_pool.py @@ -23,8 +23,8 @@ class SubnetPool(resource.Resource, tag.TagMixin): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/trunk.py b/openstack/network/v2/trunk.py index 875a08790..14bb47e10 100644 --- a/openstack/network/v2/trunk.py +++ b/openstack/network/v2/trunk.py @@ -23,8 +23,8 @@ class Trunk(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/network/v2/vpn_service.py b/openstack/network/v2/vpn_service.py index c65ee121a..f40d20c8a 100644 --- a/openstack/network/v2/vpn_service.py +++ b/openstack/network/v2/vpn_service.py @@ -24,8 +24,8 @@ class VPNService(resource.Resource): # capabilities allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True diff --git a/openstack/object_store/v1/_base.py b/openstack/object_store/v1/_base.py index ca297b0bb..4c576da64 100644 --- a/openstack/object_store/v1/_base.py +++ b/openstack/object_store/v1/_base.py @@ -19,7 +19,7 @@ from openstack import resource class BaseResource(resource.Resource): service = object_store_service.ObjectStoreService() - update_method = 'POST' + commit_method = 'POST' create_method = 'PUT' #: Metadata stored for this resource. *Type: dict* diff --git a/openstack/object_store/v1/account.py b/openstack/object_store/v1/account.py index ede5716d7..01dbd40cd 100644 --- a/openstack/object_store/v1/account.py +++ b/openstack/object_store/v1/account.py @@ -20,8 +20,8 @@ class Account(_base.BaseResource): base_path = "/" - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_head = True #: The total number of bytes that are stored in Object Storage for diff --git a/openstack/object_store/v1/container.py b/openstack/object_store/v1/container.py index 51452c882..8f90c730a 100644 --- a/openstack/object_store/v1/container.py +++ b/openstack/object_store/v1/container.py @@ -31,8 +31,8 @@ class Container(_base.BaseResource): pagination_key = 'X-Account-Container-Count' allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True allow_head = True diff --git a/openstack/object_store/v1/obj.py b/openstack/object_store/v1/obj.py index 2c305c9ef..595d0e4cd 100644 --- a/openstack/object_store/v1/obj.py +++ b/openstack/object_store/v1/obj.py @@ -35,8 +35,8 @@ class Object(_base.BaseResource): service = object_store_service.ObjectStoreService() allow_create = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True allow_list = True allow_head = True diff --git a/openstack/orchestration/v1/_proxy.py b/openstack/orchestration/v1/_proxy.py index f607de0e4..ccf9790fc 100644 --- a/openstack/orchestration/v1/_proxy.py +++ b/openstack/orchestration/v1/_proxy.py @@ -184,7 +184,7 @@ class Proxy(proxy.Proxy): stk = self._find(_stack.Stack, stack, ignore_missing=False) obj = _stack_files.StackFiles(stack_name=stk.name, stack_id=stk.id) - return obj.get(self) + return obj.fetch(self) def resources(self, stack, **query): """Return a generator of resources diff --git a/openstack/orchestration/v1/resource.py b/openstack/orchestration/v1/resource.py index 710e5dcbf..97184bb9c 100644 --- a/openstack/orchestration/v1/resource.py +++ b/openstack/orchestration/v1/resource.py @@ -26,7 +26,7 @@ class Resource(resource.Resource): allow_list = True allow_retrieve = False allow_delete = False - allow_update = False + allow_commit = False # Properties #: A list of dictionaries containing links relevant to the resource. diff --git a/openstack/orchestration/v1/software_config.py b/openstack/orchestration/v1/software_config.py index b8eb8e93d..a4f4b4fae 100644 --- a/openstack/orchestration/v1/software_config.py +++ b/openstack/orchestration/v1/software_config.py @@ -23,9 +23,9 @@ class SoftwareConfig(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True - allow_update = False + allow_commit = False # Properties #: Configuration script or manifest that defines which configuration is diff --git a/openstack/orchestration/v1/software_deployment.py b/openstack/orchestration/v1/software_deployment.py index a76cc08ef..00e4acd0c 100644 --- a/openstack/orchestration/v1/software_deployment.py +++ b/openstack/orchestration/v1/software_deployment.py @@ -23,9 +23,9 @@ class SoftwareDeployment(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True - allow_update = True + allow_commit = True # Properties #: The stack action that triggers this deployment resource. @@ -57,8 +57,8 @@ class SoftwareDeployment(resource.Resource): return super(SoftwareDeployment, self).create( session, prepend_key=False) - def update(self, session): + def commit(self, session): # This overrides the default behavior of resource creation because # heat doesn't accept resource_key in its request. - return super(SoftwareDeployment, self).update( + return super(SoftwareDeployment, self).commit( session, prepend_key=False) diff --git a/openstack/orchestration/v1/stack.py b/openstack/orchestration/v1/stack.py index 8dad7b2c6..ea4c1c889 100644 --- a/openstack/orchestration/v1/stack.py +++ b/openstack/orchestration/v1/stack.py @@ -26,8 +26,8 @@ class Stack(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True - allow_update = True + allow_fetch = True + allow_commit = True allow_delete = True # Properties @@ -81,10 +81,10 @@ class Stack(resource.Resource): # heat doesn't accept resource_key in its request. return super(Stack, self).create(session, prepend_key=False) - def update(self, session): + def commit(self, session): # This overrides the default behavior of resource creation because # heat doesn't accept resource_key in its request. - return super(Stack, self).update(session, prepend_key=False, + return super(Stack, self).commit(session, prepend_key=False, has_body=False) def _action(self, session, body): @@ -96,9 +96,11 @@ class Stack(resource.Resource): def check(self, session): return self._action(session, {'check': ''}) - def get(self, session, requires_id=True, error_message=None): - stk = super(Stack, self).get(session, requires_id=requires_id, - error_message=error_message) + def fetch(self, session, requires_id=True, error_message=None): + stk = super(Stack, self).fetch( + session, + requires_id=requires_id, + error_message=error_message) if stk and stk.status in ['DELETE_COMPLETE', 'ADOPT_COMPLETE']: raise exceptions.NotFoundException( "No stack found for %s" % stk.id) @@ -110,6 +112,6 @@ class StackPreview(Stack): allow_create = True allow_list = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False diff --git a/openstack/orchestration/v1/stack_environment.py b/openstack/orchestration/v1/stack_environment.py index dcf008f6e..2902818a9 100644 --- a/openstack/orchestration/v1/stack_environment.py +++ b/openstack/orchestration/v1/stack_environment.py @@ -22,9 +22,9 @@ class StackEnvironment(resource.Resource): # capabilities allow_create = False allow_list = False - allow_get = True + allow_fetch = True allow_delete = False - allow_update = False + allow_commit = False # Properties #: Name of the stack where the template is referenced. diff --git a/openstack/orchestration/v1/stack_files.py b/openstack/orchestration/v1/stack_files.py index e671688f2..364f50822 100644 --- a/openstack/orchestration/v1/stack_files.py +++ b/openstack/orchestration/v1/stack_files.py @@ -22,9 +22,9 @@ class StackFiles(resource.Resource): # capabilities allow_create = False allow_list = False - allow_get = True + allow_fetch = True allow_delete = False - allow_update = False + allow_commit = False # Properties #: Name of the stack where the template is referenced. @@ -32,7 +32,7 @@ class StackFiles(resource.Resource): #: ID of the stack where the template is referenced. stack_id = resource.URI('stack_id') - def get(self, session): + def fetch(self, session): # The stack files response contains a map of filenames and file # contents. request = self._prepare_request(requires_id=False) diff --git a/openstack/orchestration/v1/stack_template.py b/openstack/orchestration/v1/stack_template.py index cb8a6b896..0f0ab3545 100644 --- a/openstack/orchestration/v1/stack_template.py +++ b/openstack/orchestration/v1/stack_template.py @@ -22,9 +22,9 @@ class StackTemplate(resource.Resource): # capabilities allow_create = False allow_list = False - allow_get = True + allow_fetch = True allow_delete = False - allow_update = False + allow_commit = False # Properties #: Name of the stack where the template is referenced. diff --git a/openstack/orchestration/v1/template.py b/openstack/orchestration/v1/template.py index aa516d591..ec04b6cec 100644 --- a/openstack/orchestration/v1/template.py +++ b/openstack/orchestration/v1/template.py @@ -22,9 +22,9 @@ class Template(resource.Resource): # capabilities allow_create = False allow_list = False - allow_get = False + allow_fetch = False allow_delete = False - allow_update = False + allow_commit = False # Properties #: The description specified in the template diff --git a/openstack/proxy.py b/openstack/proxy.py index bc55b5218..7ccf2a997 100644 --- a/openstack/proxy.py +++ b/openstack/proxy.py @@ -169,7 +169,7 @@ class Proxy(six.with_metaclass(_meta.ProxyMeta, _adapter.OpenStackSDKAdapter)): :rtype: :class:`~openstack.resource.Resource` """ res = self._get_resource(resource_type, value, **attrs) - return res.update(self) + return res.commit(self) def _create(self, resource_type, **attrs): """Create a resource from attributes @@ -193,7 +193,7 @@ class Proxy(six.with_metaclass(_meta.ProxyMeta, _adapter.OpenStackSDKAdapter)): @_check_resource(strict=False) def _get(self, resource_type, value=None, requires_id=True, **attrs): - """Get a resource + """Fetch a resource :param resource_type: The type of resource to get. :type resource_type: :class:`~openstack.resource.Resource` @@ -207,12 +207,12 @@ class Proxy(six.with_metaclass(_meta.ProxyMeta, _adapter.OpenStackSDKAdapter)): or :class:`~openstack.resource.Header` values on this resource. - :returns: The result of the ``get`` + :returns: The result of the ``fetch`` :rtype: :class:`~openstack.resource.Resource` """ res = self._get_resource(resource_type, value, **attrs) - return res.get( + return res.fetch( self, requires_id=requires_id, error_message="No {resource_type} found for {value}".format( resource_type=resource_type.__name__, value=value)) diff --git a/openstack/resource.py b/openstack/resource.py index 0cea03e57..d344a6db1 100644 --- a/openstack/resource.py +++ b/openstack/resource.py @@ -328,9 +328,9 @@ class Resource(object): #: Allow create operation for this resource. allow_create = False #: Allow get operation for this resource. - allow_get = False + allow_fetch = False #: Allow update operation for this resource. - allow_update = False + allow_commit = False #: Allow delete operation for this resource. allow_delete = False #: Allow list operation for this resource. @@ -338,8 +338,12 @@ class Resource(object): #: Allow head operation for this resource. allow_head = False - #: Method for udating a resource (PUT, PATCH, POST) - update_method = "PUT" + # TODO(mordred) Unused - here for transition with OSC. Remove once + # OSC no longer checks for allow_get + allow_get = True + + #: Method for committing a resource (PUT, PATCH, POST) + commit_method = "PUT" #: Method for creating a resource (POST, PUT) create_method = "POST" @@ -793,11 +797,11 @@ class Resource(object): Subclasses can override this method if more complex logic is needed. :param session: :class`keystoneauth1.adapter.Adapter` - :param action: One of "get", "update", "create", "delete". Unused in + :param action: One of "fetch", "commit", "create", "delete". Unused in the base implementation. :return: microversion as string or ``None`` """ - if action not in ('get', 'update', 'create', 'delete'): + if action not in ('fetch', 'commit', 'create', 'delete'): raise ValueError('Invalid action: %s' % action) return self._get_microversion_for_list(session) @@ -807,7 +811,7 @@ class Resource(object): """Enforce that the microversion for action satisfies the requirement. :param session: :class`keystoneauth1.adapter.Adapter` - :param action: One of "get", "update", "create", "delete". + :param action: One of "fetch", "commit", "create", "delete". :param expected: Expected microversion. :param error_message: Optional error message with details. Will be prepended to the message generated here. @@ -876,7 +880,7 @@ class Resource(object): self._translate_response(response) return self - def get(self, session, requires_id=True, error_message=None): + def fetch(self, session, requires_id=True, error_message=None): """Get a remote resource based on this instance. :param session: The session to use for making this request. @@ -885,14 +889,14 @@ class Resource(object): should be part of the requested URI. :return: This :class:`Resource` instance. :raises: :exc:`~openstack.exceptions.MethodNotSupported` if - :data:`Resource.allow_get` is not set to ``True``. + :data:`Resource.allow_fetch` is not set to ``True``. """ - if not self.allow_get: - raise exceptions.MethodNotSupported(self, "get") + if not self.allow_fetch: + raise exceptions.MethodNotSupported(self, "fetch") request = self._prepare_request(requires_id=requires_id) session = self._get_session(session) - microversion = self._get_microversion_for(session, 'get') + microversion = self._get_microversion_for(session, 'fetch') response = session.get(request.url, microversion=microversion) kwargs = {} if error_message: @@ -918,7 +922,7 @@ class Resource(object): request = self._prepare_request() session = self._get_session(session) - microversion = self._get_microversion_for(session, 'get') + microversion = self._get_microversion_for(session, 'fetch') response = session.head(request.url, headers={"Accept": ""}, microversion=microversion) @@ -927,8 +931,8 @@ class Resource(object): self._translate_response(response, has_body=False) return self - def update(self, session, prepend_key=True, has_body=True): - """Update the remote resource based on this instance. + def commit(self, session, prepend_key=True, has_body=True): + """Commit the state of the instance to the remote resource. :param session: The session to use for making this request. :type session: :class:`~keystoneauth1.adapter.Adapter` @@ -938,37 +942,37 @@ class Resource(object): :return: This :class:`Resource` instance. :raises: :exc:`~openstack.exceptions.MethodNotSupported` if - :data:`Resource.allow_update` is not set to ``True``. + :data:`Resource.allow_commit` is not set to ``True``. """ - # The id cannot be dirty for an update + # The id cannot be dirty for an commit self._body._dirty.discard("id") - # Only try to update if we actually have anything to update. + # Only try to update if we actually have anything to commit. if not any([self._body.dirty, self._header.dirty]): return self - if not self.allow_update: - raise exceptions.MethodNotSupported(self, "update") + if not self.allow_commit: + raise exceptions.MethodNotSupported(self, "commit") request = self._prepare_request(prepend_key=prepend_key) session = self._get_session(session) - microversion = self._get_microversion_for(session, 'update') + microversion = self._get_microversion_for(session, 'commit') - if self.update_method == 'PATCH': + if self.commit_method == 'PATCH': response = session.patch( request.url, json=request.body, headers=request.headers, microversion=microversion) - elif self.update_method == 'POST': + elif self.commit_method == 'POST': response = session.post( request.url, json=request.body, headers=request.headers, microversion=microversion) - elif self.update_method == 'PUT': + elif self.commit_method == 'PUT': response = session.put( request.url, json=request.body, headers=request.headers, microversion=microversion) else: raise exceptions.ResourceFailure( - msg="Invalid update method: %s" % self.update_method) + msg="Invalid commit method: %s" % self.commit_method) self.microversion = microversion self._translate_response(response, has_body=has_body) @@ -982,7 +986,7 @@ class Resource(object): :return: This :class:`Resource` instance. :raises: :exc:`~openstack.exceptions.MethodNotSupported` if - :data:`Resource.allow_update` is not set to ``True``. + :data:`Resource.allow_commit` is not set to ``True``. """ if not self.allow_delete: raise exceptions.MethodNotSupported(self, "delete") @@ -1185,7 +1189,7 @@ class Resource(object): # Try to short-circuit by looking directly for a matching ID. try: match = cls.existing(id=name_or_id, **params) - return match.get(session) + return match.fetch(session) except exceptions.NotFoundException: pass @@ -1251,7 +1255,7 @@ def wait_for_status(session, resource, status, failures, interval=None, timeout=wait, message=msg, wait=interval): - resource = resource.get(session) + resource = resource.fetch(session) if not resource: raise exceptions.ResourceFailure( @@ -1293,7 +1297,7 @@ def wait_for_delete(session, resource, interval, wait): id=resource.id), wait=interval): try: - resource = resource.get(session) + resource = resource.fetch(session) if not resource: return orig_resource if resource.status.lower() == 'deleted': diff --git a/openstack/tests/unit/baremetal/test_version.py b/openstack/tests/unit/baremetal/test_version.py index d6f63b6bd..ddc807944 100644 --- a/openstack/tests/unit/baremetal/test_version.py +++ b/openstack/tests/unit/baremetal/test_version.py @@ -32,12 +32,12 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) self.assertFalse(sot.allow_head) - self.assertEqual('PUT', sot.update_method) + self.assertEqual('PUT', sot.commit_method) self.assertEqual('POST', sot.create_method) def test_make_it(self): diff --git a/openstack/tests/unit/baremetal/v1/test_chassis.py b/openstack/tests/unit/baremetal/v1/test_chassis.py index 216f0e92c..76e4ef44b 100644 --- a/openstack/tests/unit/baremetal/v1/test_chassis.py +++ b/openstack/tests/unit/baremetal/v1/test_chassis.py @@ -52,11 +52,11 @@ class TestChassis(base.TestCase): self.assertEqual('/chassis', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) def test_instantiate(self): sot = chassis.Chassis(**FAKE) @@ -78,8 +78,8 @@ class TestChassisDetail(base.TestCase): self.assertEqual('/chassis/detail', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/baremetal/v1/test_driver.py b/openstack/tests/unit/baremetal/v1/test_driver.py index dafd870a6..075ac0c14 100644 --- a/openstack/tests/unit/baremetal/v1/test_driver.py +++ b/openstack/tests/unit/baremetal/v1/test_driver.py @@ -52,8 +52,8 @@ class TestDriver(base.TestCase): self.assertEqual('/drivers', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/baremetal/v1/test_node.py b/openstack/tests/unit/baremetal/v1/test_node.py index 3ae7da564..3629b1adc 100644 --- a/openstack/tests/unit/baremetal/v1/test_node.py +++ b/openstack/tests/unit/baremetal/v1/test_node.py @@ -103,11 +103,11 @@ class TestNode(base.TestCase): self.assertEqual('/nodes', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) def test_instantiate(self): sot = node.Node(**FAKE) @@ -157,8 +157,8 @@ class TestNodeDetail(base.TestCase): self.assertEqual('/nodes/detail', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -202,59 +202,59 @@ class TestNodeDetail(base.TestCase): @mock.patch('time.sleep', lambda _t: None) -@mock.patch.object(node.Node, 'get', autospec=True) +@mock.patch.object(node.Node, 'fetch', autospec=True) class TestNodeWaitForProvisionState(base.TestCase): def setUp(self): super(TestNodeWaitForProvisionState, self).setUp() self.node = node.Node(**FAKE) self.session = mock.Mock() - def test_success(self, mock_get): + def test_success(self, mock_fetch): def _get_side_effect(_self, session): self.node.provision_state = 'manageable' self.assertIs(session, self.session) - mock_get.side_effect = _get_side_effect + mock_fetch.side_effect = _get_side_effect node = self.node.wait_for_provision_state(self.session, 'manageable') self.assertIs(node, self.node) - def test_failure(self, mock_get): + def test_failure(self, mock_fetch): def _get_side_effect(_self, session): self.node.provision_state = 'deploy failed' self.assertIs(session, self.session) - mock_get.side_effect = _get_side_effect + mock_fetch.side_effect = _get_side_effect self.assertRaisesRegex(exceptions.SDKException, 'failure state "deploy failed"', self.node.wait_for_provision_state, self.session, 'manageable') - def test_enroll_as_failure(self, mock_get): + def test_enroll_as_failure(self, mock_fetch): def _get_side_effect(_self, session): self.node.provision_state = 'enroll' self.node.last_error = 'power failure' self.assertIs(session, self.session) - mock_get.side_effect = _get_side_effect + mock_fetch.side_effect = _get_side_effect self.assertRaisesRegex(exceptions.SDKException, 'failed to verify management credentials', self.node.wait_for_provision_state, self.session, 'manageable') - def test_timeout(self, mock_get): + def test_timeout(self, mock_fetch): self.assertRaises(exceptions.ResourceTimeout, self.node.wait_for_provision_state, self.session, 'manageable', timeout=0.001) - def test_not_abort_on_failed_state(self, mock_get): + def test_not_abort_on_failed_state(self, mock_fetch): def _get_side_effect(_self, session): self.node.provision_state = 'deploy failed' self.assertIs(session, self.session) - mock_get.side_effect = _get_side_effect + mock_fetch.side_effect = _get_side_effect self.assertRaises(exceptions.ResourceTimeout, self.node.wait_for_provision_state, @@ -262,7 +262,7 @@ class TestNodeWaitForProvisionState(base.TestCase): abort_on_failed_state=False) -@mock.patch.object(node.Node, 'get', lambda self, session: self) +@mock.patch.object(node.Node, 'fetch', lambda self, session: self) @mock.patch.object(exceptions, 'raise_from_response', mock.Mock()) class TestNodeSetProvisionState(base.TestCase): diff --git a/openstack/tests/unit/baremetal/v1/test_port.py b/openstack/tests/unit/baremetal/v1/test_port.py index 466590146..61b9cce75 100644 --- a/openstack/tests/unit/baremetal/v1/test_port.py +++ b/openstack/tests/unit/baremetal/v1/test_port.py @@ -51,11 +51,11 @@ class TestPort(base.TestCase): self.assertEqual('/ports', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) def test_instantiate(self): sot = port.PortDetail(**FAKE) @@ -82,8 +82,8 @@ class TestPortDetail(base.TestCase): self.assertEqual('/ports/detail', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/baremetal/v1/test_port_group.py b/openstack/tests/unit/baremetal/v1/test_port_group.py index 0f0432ff2..3cfe051fb 100644 --- a/openstack/tests/unit/baremetal/v1/test_port_group.py +++ b/openstack/tests/unit/baremetal/v1/test_port_group.py @@ -56,11 +56,11 @@ class TestPortGroup(base.TestCase): self.assertEqual('/portgroups', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) def test_instantiate(self): sot = port_group.PortGroup(**FAKE) @@ -87,8 +87,8 @@ class TestPortGroupDetail(base.TestCase): self.assertEqual('/portgroups/detail', sot.base_path) self.assertEqual('baremetal', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/block_storage/v2/test_snapshot.py b/openstack/tests/unit/block_storage/v2/test_snapshot.py index 46a048d1a..a062ef9b9 100644 --- a/openstack/tests/unit/block_storage/v2/test_snapshot.py +++ b/openstack/tests/unit/block_storage/v2/test_snapshot.py @@ -46,8 +46,8 @@ class TestSnapshot(base.TestCase): self.assertEqual("snapshots", sot.resources_key) self.assertEqual("/snapshots", sot.base_path) self.assertEqual("block-storage", sot.service.service_type) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_create) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/block_storage/v2/test_type.py b/openstack/tests/unit/block_storage/v2/test_type.py index f23372d19..393d9cdd2 100644 --- a/openstack/tests/unit/block_storage/v2/test_type.py +++ b/openstack/tests/unit/block_storage/v2/test_type.py @@ -33,10 +33,10 @@ class TestType(base.TestCase): self.assertEqual("/types", sot.base_path) self.assertEqual("block-storage", sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) def test_new(self): sot = type.Type.new(id=FAKE_ID) diff --git a/openstack/tests/unit/block_storage/v2/test_volume.py b/openstack/tests/unit/block_storage/v2/test_volume.py index a90c84cbd..e3edcd072 100644 --- a/openstack/tests/unit/block_storage/v2/test_volume.py +++ b/openstack/tests/unit/block_storage/v2/test_volume.py @@ -69,9 +69,9 @@ class TestVolume(base.TestCase): self.assertEqual("volumes", sot.resources_key) self.assertEqual("/volumes", sot.base_path) self.assertEqual("block-storage", sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/block_store/v2/test_stats.py b/openstack/tests/unit/block_store/v2/test_stats.py index 0ccb7eef6..ed87eba5e 100644 --- a/openstack/tests/unit/block_store/v2/test_stats.py +++ b/openstack/tests/unit/block_store/v2/test_stats.py @@ -41,7 +41,7 @@ class TestBackendPools(base.TestCase): sot.base_path) self.assertEqual("volume", sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) + self.assertFalse(sot.allow_fetch) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) diff --git a/openstack/tests/unit/clustering/test_version.py b/openstack/tests/unit/clustering/test_version.py index 60d7b0c3f..f6fff193b 100644 --- a/openstack/tests/unit/clustering/test_version.py +++ b/openstack/tests/unit/clustering/test_version.py @@ -31,8 +31,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/clustering/v1/test_action.py b/openstack/tests/unit/clustering/v1/test_action.py index a4d462b95..e506fc203 100644 --- a/openstack/tests/unit/clustering/v1/test_action.py +++ b/openstack/tests/unit/clustering/v1/test_action.py @@ -54,7 +54,7 @@ class TestAction(base.TestCase): self.assertEqual('actions', sot.resources_key) self.assertEqual('/actions', sot.base_path) self.assertEqual('clustering', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) def test_instantiate(self): diff --git a/openstack/tests/unit/clustering/v1/test_build_info.py b/openstack/tests/unit/clustering/v1/test_build_info.py index 8d209d603..4532c2634 100644 --- a/openstack/tests/unit/clustering/v1/test_build_info.py +++ b/openstack/tests/unit/clustering/v1/test_build_info.py @@ -35,7 +35,7 @@ class TestBuildInfo(base.TestCase): self.assertEqual('/build-info', sot.base_path) self.assertEqual('build_info', sot.resource_key) self.assertEqual('clustering', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) def test_instantiate(self): sot = build_info.BuildInfo(**FAKE) diff --git a/openstack/tests/unit/clustering/v1/test_cluster.py b/openstack/tests/unit/clustering/v1/test_cluster.py index 52ee8f8c4..e79e397e3 100644 --- a/openstack/tests/unit/clustering/v1/test_cluster.py +++ b/openstack/tests/unit/clustering/v1/test_cluster.py @@ -77,8 +77,8 @@ class TestCluster(base.TestCase): self.assertEqual('/clusters', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/clustering/v1/test_cluster_policy.py b/openstack/tests/unit/clustering/v1/test_cluster_policy.py index 5ce71ae3e..e6f3de548 100644 --- a/openstack/tests/unit/clustering/v1/test_cluster_policy.py +++ b/openstack/tests/unit/clustering/v1/test_cluster_policy.py @@ -38,7 +38,7 @@ class TestClusterPolicy(base.TestCase): self.assertEqual('/clusters/%(cluster_id)s/policies', sot.base_path) self.assertEqual('clustering', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) self.assertDictEqual({"policy_name": "policy_name", diff --git a/openstack/tests/unit/clustering/v1/test_event.py b/openstack/tests/unit/clustering/v1/test_event.py index 47c80c7d2..8464c0ea3 100644 --- a/openstack/tests/unit/clustering/v1/test_event.py +++ b/openstack/tests/unit/clustering/v1/test_event.py @@ -42,7 +42,7 @@ class TestEvent(base.TestCase): self.assertEqual('events', sot.resources_key) self.assertEqual('/events', sot.base_path) self.assertEqual('clustering', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) def test_instantiate(self): diff --git a/openstack/tests/unit/clustering/v1/test_node.py b/openstack/tests/unit/clustering/v1/test_node.py index 65868b728..6a454cb05 100644 --- a/openstack/tests/unit/clustering/v1/test_node.py +++ b/openstack/tests/unit/clustering/v1/test_node.py @@ -46,8 +46,8 @@ class TestNode(base.TestCase): self.assertEqual('/nodes', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -162,7 +162,7 @@ class TestNodeDetail(base.TestCase): sot = node.NodeDetail() self.assertEqual('/nodes/%(node_id)s?show_details=True', sot.base_path) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) diff --git a/openstack/tests/unit/clustering/v1/test_policy.py b/openstack/tests/unit/clustering/v1/test_policy.py index 137e6214b..f565b6032 100644 --- a/openstack/tests/unit/clustering/v1/test_policy.py +++ b/openstack/tests/unit/clustering/v1/test_policy.py @@ -53,8 +53,8 @@ class TestPolicy(base.TestCase): self.assertEqual('/policies', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -83,7 +83,7 @@ class TestPolicyValidate(base.TestCase): self.assertEqual('/policies/validate', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) diff --git a/openstack/tests/unit/clustering/v1/test_policy_type.py b/openstack/tests/unit/clustering/v1/test_policy_type.py index defdd6944..6ebf45db2 100644 --- a/openstack/tests/unit/clustering/v1/test_policy_type.py +++ b/openstack/tests/unit/clustering/v1/test_policy_type.py @@ -37,7 +37,7 @@ class TestPolicyType(base.TestCase): self.assertEqual('policy_types', sot.resources_key) self.assertEqual('/policy-types', sot.base_path) self.assertEqual('clustering', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) def test_instantiate(self): diff --git a/openstack/tests/unit/clustering/v1/test_profile.py b/openstack/tests/unit/clustering/v1/test_profile.py index 047e5c037..4165f4cec 100644 --- a/openstack/tests/unit/clustering/v1/test_profile.py +++ b/openstack/tests/unit/clustering/v1/test_profile.py @@ -53,11 +53,11 @@ class TestProfile(base.TestCase): self.assertEqual('/profiles', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) def test_instantiate(self): sot = profile.Profile(**FAKE) @@ -85,8 +85,8 @@ class TestProfileValidate(base.TestCase): self.assertEqual('/profiles/validate', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) - self.assertEqual('PUT', sot.update_method) + self.assertEqual('PUT', sot.commit_method) diff --git a/openstack/tests/unit/clustering/v1/test_profile_type.py b/openstack/tests/unit/clustering/v1/test_profile_type.py index 6c1ffd5ca..ee5e7fa43 100644 --- a/openstack/tests/unit/clustering/v1/test_profile_type.py +++ b/openstack/tests/unit/clustering/v1/test_profile_type.py @@ -38,7 +38,7 @@ class TestProfileType(base.TestCase): self.assertEqual('profile_types', sot.resources_key) self.assertEqual('/profile-types', sot.base_path) self.assertEqual('clustering', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) def test_instantiate(self): diff --git a/openstack/tests/unit/clustering/v1/test_receiver.py b/openstack/tests/unit/clustering/v1/test_receiver.py index ad6fedf8a..27b340c4d 100644 --- a/openstack/tests/unit/clustering/v1/test_receiver.py +++ b/openstack/tests/unit/clustering/v1/test_receiver.py @@ -52,8 +52,8 @@ class TestReceiver(base.TestCase): self.assertEqual('/receivers', sot.base_path) self.assertEqual('clustering', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/test_version.py b/openstack/tests/unit/compute/test_version.py index 45bf2d69a..2f460f260 100644 --- a/openstack/tests/unit/compute/test_version.py +++ b/openstack/tests/unit/compute/test_version.py @@ -32,8 +32,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_extension.py b/openstack/tests/unit/compute/v2/test_extension.py index 86bfa96ec..1cc35f680 100644 --- a/openstack/tests/unit/compute/v2/test_extension.py +++ b/openstack/tests/unit/compute/v2/test_extension.py @@ -34,8 +34,8 @@ class TestExtension(base.TestCase): self.assertEqual('/extensions', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_flavor.py b/openstack/tests/unit/compute/v2/test_flavor.py index 745fddc13..9c5080c73 100644 --- a/openstack/tests/unit/compute/v2/test_flavor.py +++ b/openstack/tests/unit/compute/v2/test_flavor.py @@ -40,10 +40,10 @@ class TestFlavor(base.TestCase): self.assertEqual('/flavors', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) self.assertDictEqual({"sort_key": "sort_key", "sort_dir": "sort_dir", @@ -79,7 +79,7 @@ class TestFlavor(base.TestCase): self.assertEqual('/flavors/detail', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_hypervisor.py b/openstack/tests/unit/compute/v2/test_hypervisor.py index 9ef80b4cd..ae369351e 100644 --- a/openstack/tests/unit/compute/v2/test_hypervisor.py +++ b/openstack/tests/unit/compute/v2/test_hypervisor.py @@ -50,7 +50,7 @@ class TestHypervisor(base.TestCase): self.assertEqual('hypervisors', sot.resources_key) self.assertEqual('/os-hypervisors', sot.base_path) self.assertEqual('compute', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) def test_make_it(self): @@ -83,5 +83,5 @@ class TestHypervisor(base.TestCase): self.assertEqual('hypervisors', sot.resources_key) self.assertEqual('/os-hypervisors/detail', sot.base_path) self.assertEqual('compute', sot.service.service_type) - self.assertFalse(sot.allow_get) + self.assertFalse(sot.allow_fetch) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_image.py b/openstack/tests/unit/compute/v2/test_image.py index 158beba41..24f7f2a91 100644 --- a/openstack/tests/unit/compute/v2/test_image.py +++ b/openstack/tests/unit/compute/v2/test_image.py @@ -45,8 +45,8 @@ class TestImage(base.TestCase): self.assertEqual('/images', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -74,8 +74,8 @@ class TestImage(base.TestCase): self.assertEqual('/images/detail', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_keypair.py b/openstack/tests/unit/compute/v2/test_keypair.py index 54efd3871..c0e7d974a 100644 --- a/openstack/tests/unit/compute/v2/test_keypair.py +++ b/openstack/tests/unit/compute/v2/test_keypair.py @@ -31,8 +31,8 @@ class TestKeypair(base.TestCase): self.assertEqual('/os-keypairs', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_limits.py b/openstack/tests/unit/compute/v2/test_limits.py index 90144875a..398d324e8 100644 --- a/openstack/tests/unit/compute/v2/test_limits.py +++ b/openstack/tests/unit/compute/v2/test_limits.py @@ -71,8 +71,8 @@ class TestAbsoluteLimits(base.TestCase): self.assertEqual("", sot.base_path) self.assertIsNone(sot.service) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) @@ -121,8 +121,8 @@ class TestRateLimit(base.TestCase): self.assertEqual("", sot.base_path) self.assertIsNone(sot.service) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) @@ -140,9 +140,9 @@ class TestLimits(base.TestCase): self.assertEqual("limits", sot.resource_key) self.assertEqual("/limits", sot.base_path) self.assertEqual("compute", sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) @@ -155,7 +155,7 @@ class TestLimits(base.TestCase): resp.headers = {} resp.status_code = 200 - sot = limits.Limits().get(sess) + sot = limits.Limits().fetch(sess) self.assertEqual(ABSOLUTE_LIMITS["maxImageMeta"], sot.absolute.image_meta) diff --git a/openstack/tests/unit/compute/v2/test_server.py b/openstack/tests/unit/compute/v2/test_server.py index bb9cc6b28..45bf4ebc2 100644 --- a/openstack/tests/unit/compute/v2/test_server.py +++ b/openstack/tests/unit/compute/v2/test_server.py @@ -75,8 +75,8 @@ class TestServer(base.TestCase): self.assertEqual('/servers', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -157,8 +157,8 @@ class TestServer(base.TestCase): self.assertEqual('/servers/detail', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_server_group.py b/openstack/tests/unit/compute/v2/test_server_group.py index 224c5efca..d9c954dd7 100644 --- a/openstack/tests/unit/compute/v2/test_server_group.py +++ b/openstack/tests/unit/compute/v2/test_server_group.py @@ -32,8 +32,8 @@ class TestServerGroup(base.TestCase): self.assertEqual('/os-server-groups', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_server_interface.py b/openstack/tests/unit/compute/v2/test_server_interface.py index b0374f5b1..973923204 100644 --- a/openstack/tests/unit/compute/v2/test_server_interface.py +++ b/openstack/tests/unit/compute/v2/test_server_interface.py @@ -39,8 +39,8 @@ class TestServerInterface(base.TestCase): self.assertEqual('/servers/%(server_id)s/os-interface', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_server_ip.py b/openstack/tests/unit/compute/v2/test_server_ip.py index ab3fce4d3..66fed38df 100644 --- a/openstack/tests/unit/compute/v2/test_server_ip.py +++ b/openstack/tests/unit/compute/v2/test_server_ip.py @@ -31,8 +31,8 @@ class TestServerIP(base.TestCase): self.assertEqual('/servers/%(server_id)s/ips', sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/compute/v2/test_service.py b/openstack/tests/unit/compute/v2/test_service.py index 4ef25c812..094792a7f 100644 --- a/openstack/tests/unit/compute/v2/test_service.py +++ b/openstack/tests/unit/compute/v2/test_service.py @@ -42,9 +42,9 @@ class TestService(base.TestCase): self.assertEqual('services', sot.resources_key) self.assertEqual('/os-services', sot.base_path) self.assertEqual('compute', sot.service.service_type) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_list) - self.assertFalse(sot.allow_get) + self.assertFalse(sot.allow_fetch) def test_make_it(self): sot = service.Service(**EXAMPLE) diff --git a/openstack/tests/unit/compute/v2/test_volume_attachment.py b/openstack/tests/unit/compute/v2/test_volume_attachment.py index 30d999dbd..623a931e7 100644 --- a/openstack/tests/unit/compute/v2/test_volume_attachment.py +++ b/openstack/tests/unit/compute/v2/test_volume_attachment.py @@ -31,8 +31,8 @@ class TestServerInterface(base.TestCase): sot.base_path) self.assertEqual('compute', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) self.assertDictEqual({"limit": "limit", diff --git a/openstack/tests/unit/database/v1/test_database.py b/openstack/tests/unit/database/v1/test_database.py index d136bcbb3..477672a36 100644 --- a/openstack/tests/unit/database/v1/test_database.py +++ b/openstack/tests/unit/database/v1/test_database.py @@ -36,8 +36,8 @@ class TestDatabase(base.TestCase): self.assertEqual('database', sot.service.service_type) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) def test_make_it(self): diff --git a/openstack/tests/unit/database/v1/test_flavor.py b/openstack/tests/unit/database/v1/test_flavor.py index bb6b1c83a..82f850e6f 100644 --- a/openstack/tests/unit/database/v1/test_flavor.py +++ b/openstack/tests/unit/database/v1/test_flavor.py @@ -33,8 +33,8 @@ class TestFlavor(base.TestCase): self.assertEqual('database', sot.service.service_type) self.assertTrue(sot.allow_list) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) def test_make_it(self): diff --git a/openstack/tests/unit/database/v1/test_instance.py b/openstack/tests/unit/database/v1/test_instance.py index c217ff062..8fd650ebb 100644 --- a/openstack/tests/unit/database/v1/test_instance.py +++ b/openstack/tests/unit/database/v1/test_instance.py @@ -40,8 +40,8 @@ class TestInstance(base.TestCase): self.assertEqual('/instances', sot.base_path) self.assertEqual('database', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/database/v1/test_user.py b/openstack/tests/unit/database/v1/test_user.py index 83a91a8ef..5752024d7 100644 --- a/openstack/tests/unit/database/v1/test_user.py +++ b/openstack/tests/unit/database/v1/test_user.py @@ -32,8 +32,8 @@ class TestUser(base.TestCase): self.assertEqual('/instances/%(instance_id)s/users', sot.base_path) self.assertEqual('database', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/test_version.py b/openstack/tests/unit/identity/test_version.py index a53a8b2c1..c18eaadef 100644 --- a/openstack/tests/unit/identity/test_version.py +++ b/openstack/tests/unit/identity/test_version.py @@ -33,8 +33,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v2/test_extension.py b/openstack/tests/unit/identity/v2/test_extension.py index d7e768f71..557d3fb54 100644 --- a/openstack/tests/unit/identity/v2/test_extension.py +++ b/openstack/tests/unit/identity/v2/test_extension.py @@ -35,8 +35,8 @@ class TestExtension(base.TestCase): self.assertEqual('/extensions', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v2/test_role.py b/openstack/tests/unit/identity/v2/test_role.py index a1d2e060a..02912a9f2 100644 --- a/openstack/tests/unit/identity/v2/test_role.py +++ b/openstack/tests/unit/identity/v2/test_role.py @@ -32,8 +32,8 @@ class TestRole(base.TestCase): self.assertEqual('/OS-KSADM/roles', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v2/test_tenant.py b/openstack/tests/unit/identity/v2/test_tenant.py index a0c63219e..3c7fd7bf4 100644 --- a/openstack/tests/unit/identity/v2/test_tenant.py +++ b/openstack/tests/unit/identity/v2/test_tenant.py @@ -32,8 +32,8 @@ class TestTenant(base.TestCase): self.assertEqual('/tenants', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v2/test_user.py b/openstack/tests/unit/identity/v2/test_user.py index 3fae75902..0c495c2e5 100644 --- a/openstack/tests/unit/identity/v2/test_user.py +++ b/openstack/tests/unit/identity/v2/test_user.py @@ -32,8 +32,8 @@ class TestUser(base.TestCase): self.assertEqual('/users', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v3/test_credential.py b/openstack/tests/unit/identity/v3/test_credential.py index 8fc9676d3..7f6d2dc1d 100644 --- a/openstack/tests/unit/identity/v3/test_credential.py +++ b/openstack/tests/unit/identity/v3/test_credential.py @@ -33,11 +33,11 @@ class TestCredential(base.TestCase): self.assertEqual('/credentials', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { diff --git a/openstack/tests/unit/identity/v3/test_domain.py b/openstack/tests/unit/identity/v3/test_domain.py index 2d75d9e3c..33ec294dd 100644 --- a/openstack/tests/unit/identity/v3/test_domain.py +++ b/openstack/tests/unit/identity/v3/test_domain.py @@ -33,11 +33,11 @@ class TestDomain(base.TestCase): self.assertEqual('/domains', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { diff --git a/openstack/tests/unit/identity/v3/test_endpoint.py b/openstack/tests/unit/identity/v3/test_endpoint.py index 53a27d4c6..090c0b346 100644 --- a/openstack/tests/unit/identity/v3/test_endpoint.py +++ b/openstack/tests/unit/identity/v3/test_endpoint.py @@ -35,11 +35,11 @@ class TestEndpoint(base.TestCase): self.assertEqual('/endpoints', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { 'interface': 'interface', diff --git a/openstack/tests/unit/identity/v3/test_group.py b/openstack/tests/unit/identity/v3/test_group.py index edb17f09c..515ee9c3b 100644 --- a/openstack/tests/unit/identity/v3/test_group.py +++ b/openstack/tests/unit/identity/v3/test_group.py @@ -32,11 +32,11 @@ class TestGroup(base.TestCase): self.assertEqual('/groups', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { diff --git a/openstack/tests/unit/identity/v3/test_policy.py b/openstack/tests/unit/identity/v3/test_policy.py index 0533b9382..885d7b002 100644 --- a/openstack/tests/unit/identity/v3/test_policy.py +++ b/openstack/tests/unit/identity/v3/test_policy.py @@ -34,11 +34,11 @@ class TestPolicy(base.TestCase): self.assertEqual('/policies', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) def test_make_it(self): sot = policy.Policy(**EXAMPLE) diff --git a/openstack/tests/unit/identity/v3/test_project.py b/openstack/tests/unit/identity/v3/test_project.py index 246adaf43..62d3437a3 100644 --- a/openstack/tests/unit/identity/v3/test_project.py +++ b/openstack/tests/unit/identity/v3/test_project.py @@ -35,11 +35,11 @@ class TestProject(base.TestCase): self.assertEqual('/projects', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { @@ -73,7 +73,7 @@ class TestUserProject(base.TestCase): self.assertEqual('/users/%(user_id)s/projects', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v3/test_region.py b/openstack/tests/unit/identity/v3/test_region.py index b3c54f121..6657ca5cb 100644 --- a/openstack/tests/unit/identity/v3/test_region.py +++ b/openstack/tests/unit/identity/v3/test_region.py @@ -32,11 +32,11 @@ class TestRegion(base.TestCase): self.assertEqual('/regions', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { diff --git a/openstack/tests/unit/identity/v3/test_role.py b/openstack/tests/unit/identity/v3/test_role.py index 957cfbb99..59d2a592a 100644 --- a/openstack/tests/unit/identity/v3/test_role.py +++ b/openstack/tests/unit/identity/v3/test_role.py @@ -31,8 +31,8 @@ class TestRole(base.TestCase): self.assertEqual('/roles', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v3/test_service.py b/openstack/tests/unit/identity/v3/test_service.py index 0abceb6ea..d6716f3f6 100644 --- a/openstack/tests/unit/identity/v3/test_service.py +++ b/openstack/tests/unit/identity/v3/test_service.py @@ -34,11 +34,11 @@ class TestService(base.TestCase): self.assertEqual('/services', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { diff --git a/openstack/tests/unit/identity/v3/test_trust.py b/openstack/tests/unit/identity/v3/test_trust.py index 258a6ce8e..7028e0af0 100644 --- a/openstack/tests/unit/identity/v3/test_trust.py +++ b/openstack/tests/unit/identity/v3/test_trust.py @@ -41,7 +41,7 @@ class TestTrust(base.TestCase): self.assertEqual('/OS-TRUST/trusts', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/identity/v3/test_user.py b/openstack/tests/unit/identity/v3/test_user.py index d09835747..f75eb6e7d 100644 --- a/openstack/tests/unit/identity/v3/test_user.py +++ b/openstack/tests/unit/identity/v3/test_user.py @@ -38,11 +38,11 @@ class TestUser(base.TestCase): self.assertEqual('/users', sot.base_path) self.assertEqual('identity', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) - self.assertEqual('PATCH', sot.update_method) + self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { diff --git a/openstack/tests/unit/image/v1/test_image.py b/openstack/tests/unit/image/v1/test_image.py index d40e73535..256f9892c 100644 --- a/openstack/tests/unit/image/v1/test_image.py +++ b/openstack/tests/unit/image/v1/test_image.py @@ -45,8 +45,8 @@ class TestImage(base.TestCase): self.assertEqual('/images', sot.base_path) self.assertEqual('image', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/image/v2/test_image.py b/openstack/tests/unit/image/v2/test_image.py index d1367f3d0..b5a8b870c 100644 --- a/openstack/tests/unit/image/v2/test_image.py +++ b/openstack/tests/unit/image/v2/test_image.py @@ -115,8 +115,8 @@ class TestImage(base.TestCase): self.assertEqual('/images', sot.base_path) self.assertEqual('image', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -333,7 +333,7 @@ class TestImage(base.TestCase): fake_img['name'] = 'fake_name' fake_img['new_property'] = 'fake_value' - sot.update(self.sess, **fake_img) + sot.commit(self.sess, **fake_img) url = 'images/' + IDENTIFIER self.sess.patch.assert_called_once() call = self.sess.patch.call_args diff --git a/openstack/tests/unit/image/v2/test_member.py b/openstack/tests/unit/image/v2/test_member.py index 8a3e35e50..e0e2a6fe0 100644 --- a/openstack/tests/unit/image/v2/test_member.py +++ b/openstack/tests/unit/image/v2/test_member.py @@ -33,8 +33,8 @@ class TestMember(base.TestCase): self.assertEqual('image', sot.service.service_type) self.assertEqual('member', sot._alternate_id()) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/image/v2/test_proxy.py b/openstack/tests/unit/image/v2/test_proxy.py index c8fe4afd5..14cff8271 100644 --- a/openstack/tests/unit/image/v2/test_proxy.py +++ b/openstack/tests/unit/image/v2/test_proxy.py @@ -58,14 +58,14 @@ class TestImageProxy(test_proxy_base.TestProxyBase): @mock.patch("openstack.resource.Resource._translate_response") @mock.patch("openstack.proxy.Proxy._get") - @mock.patch("openstack.image.v2.image.Image.update") - def test_image_update(self, mock_update_image, mock_get_image, + @mock.patch("openstack.image.v2.image.Image.commit") + def test_image_update(self, mock_commit_image, mock_get_image, mock_transpose): original_image = image.Image(**EXAMPLE) mock_get_image.return_value = original_image EXAMPLE['name'] = 'fake_name' updated_image = image.Image(**EXAMPLE) - mock_update_image.return_value = updated_image.to_dict() + mock_commit_image.return_value = updated_image.to_dict() result = self.proxy.update_image(original_image, **updated_image.to_dict()) self.assertEqual('fake_name', result.get('name')) diff --git a/openstack/tests/unit/instance_ha/v1/test_host.py b/openstack/tests/unit/instance_ha/v1/test_host.py index 4aea38b56..2d20bdfdc 100644 --- a/openstack/tests/unit/instance_ha/v1/test_host.py +++ b/openstack/tests/unit/instance_ha/v1/test_host.py @@ -46,9 +46,9 @@ class TestHost(base.TestCase): self.assertEqual("/segments/%(segment_id)s/hosts", sot.base_path) self.assertEqual("ha", sot.service.service_type) self.assertTrue(sot.allow_list) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertDictEqual({"failover_segment_id": "failover_segment_id", diff --git a/openstack/tests/unit/instance_ha/v1/test_notification.py b/openstack/tests/unit/instance_ha/v1/test_notification.py index b18da458c..e5566404f 100644 --- a/openstack/tests/unit/instance_ha/v1/test_notification.py +++ b/openstack/tests/unit/instance_ha/v1/test_notification.py @@ -46,9 +46,9 @@ class TestNotification(base.TestCase): self.assertEqual("/notifications", sot.base_path) self.assertEqual("ha", sot.service.service_type) self.assertTrue(sot.allow_list) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_create) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertDictEqual({"generated_since": "generated-since", diff --git a/openstack/tests/unit/instance_ha/v1/test_segment.py b/openstack/tests/unit/instance_ha/v1/test_segment.py index 87cf870f1..7659eb8e1 100644 --- a/openstack/tests/unit/instance_ha/v1/test_segment.py +++ b/openstack/tests/unit/instance_ha/v1/test_segment.py @@ -38,9 +38,9 @@ class TestSegment(base.TestCase): self.assertEqual("/segments", sot.base_path) self.assertEqual("ha", sot.service.service_type) self.assertTrue(sot.allow_list) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertDictEqual({"limit": "limit", diff --git a/openstack/tests/unit/key_manager/v1/test_container.py b/openstack/tests/unit/key_manager/v1/test_container.py index 5bd665ff1..ffc395a47 100644 --- a/openstack/tests/unit/key_manager/v1/test_container.py +++ b/openstack/tests/unit/key_manager/v1/test_container.py @@ -37,8 +37,8 @@ class TestContainer(base.TestCase): self.assertEqual('/containers', sot.base_path) self.assertEqual('key-manager', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/key_manager/v1/test_order.py b/openstack/tests/unit/key_manager/v1/test_order.py index 3c6590ff3..fd246e418 100644 --- a/openstack/tests/unit/key_manager/v1/test_order.py +++ b/openstack/tests/unit/key_manager/v1/test_order.py @@ -40,8 +40,8 @@ class TestOrder(base.TestCase): self.assertEqual('/orders', sot.base_path) self.assertEqual('key-manager', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/key_manager/v1/test_secret.py b/openstack/tests/unit/key_manager/v1/test_secret.py index 2db2d4cb5..ae4154c4d 100644 --- a/openstack/tests/unit/key_manager/v1/test_secret.py +++ b/openstack/tests/unit/key_manager/v1/test_secret.py @@ -44,8 +44,8 @@ class TestSecret(base.TestCase): self.assertEqual('/secrets', sot.base_path) self.assertEqual('key-manager', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -92,7 +92,7 @@ class TestSecret(base.TestCase): rv.json = mock.Mock(return_value=return_body) sess.get = mock.Mock(return_value=rv) - sot.get(sess) + sot.fetch(sess) sess.get.assert_called_once_with("secrets/id") @@ -110,7 +110,7 @@ class TestSecret(base.TestCase): sess = mock.Mock() sess.get = mock.Mock(side_effect=[metadata_response, payload_response]) - rv = sot.get(sess) + rv = sot.fetch(sess) sess.get.assert_has_calls( [mock.call("secrets/id",), diff --git a/openstack/tests/unit/load_balancer/test_health_monitor.py b/openstack/tests/unit/load_balancer/test_health_monitor.py index 771d30de9..0840f44a5 100644 --- a/openstack/tests/unit/load_balancer/test_health_monitor.py +++ b/openstack/tests/unit/load_balancer/test_health_monitor.py @@ -47,8 +47,8 @@ class TestPoolHealthMonitor(base.TestCase): self.assertEqual('/v2.0/lbaas/healthmonitors', test_hm.base_path) self.assertEqual('load-balancer', test_hm.service.service_type) self.assertTrue(test_hm.allow_create) - self.assertTrue(test_hm.allow_get) - self.assertTrue(test_hm.allow_update) + self.assertTrue(test_hm.allow_fetch) + self.assertTrue(test_hm.allow_commit) self.assertTrue(test_hm.allow_delete) self.assertTrue(test_hm.allow_list) diff --git a/openstack/tests/unit/load_balancer/test_l7policy.py b/openstack/tests/unit/load_balancer/test_l7policy.py index 60492436b..91a62ff0a 100644 --- a/openstack/tests/unit/load_balancer/test_l7policy.py +++ b/openstack/tests/unit/load_balancer/test_l7policy.py @@ -43,8 +43,8 @@ class TestL7Policy(base.TestCase): self.assertEqual('/v2.0/lbaas/l7policies', test_l7_policy.base_path) self.assertEqual('load-balancer', test_l7_policy.service.service_type) self.assertTrue(test_l7_policy.allow_create) - self.assertTrue(test_l7_policy.allow_get) - self.assertTrue(test_l7_policy.allow_update) + self.assertTrue(test_l7_policy.allow_fetch) + self.assertTrue(test_l7_policy.allow_commit) self.assertTrue(test_l7_policy.allow_delete) self.assertTrue(test_l7_policy.allow_list) diff --git a/openstack/tests/unit/load_balancer/test_l7rule.py b/openstack/tests/unit/load_balancer/test_l7rule.py index 6afe925e2..b46f0b3c1 100644 --- a/openstack/tests/unit/load_balancer/test_l7rule.py +++ b/openstack/tests/unit/load_balancer/test_l7rule.py @@ -42,8 +42,8 @@ class TestL7Rule(base.TestCase): test_l7rule.base_path) self.assertEqual('load-balancer', test_l7rule.service.service_type) self.assertTrue(test_l7rule.allow_create) - self.assertTrue(test_l7rule.allow_get) - self.assertTrue(test_l7rule.allow_update) + self.assertTrue(test_l7rule.allow_fetch) + self.assertTrue(test_l7rule.allow_commit) self.assertTrue(test_l7rule.allow_delete) self.assertTrue(test_l7rule.allow_list) diff --git a/openstack/tests/unit/load_balancer/test_listener.py b/openstack/tests/unit/load_balancer/test_listener.py index 3eeebf212..b104d8e84 100644 --- a/openstack/tests/unit/load_balancer/test_listener.py +++ b/openstack/tests/unit/load_balancer/test_listener.py @@ -52,8 +52,8 @@ class TestListener(base.TestCase): self.assertEqual('/v2.0/lbaas/listeners', test_listener.base_path) self.assertEqual('load-balancer', test_listener.service.service_type) self.assertTrue(test_listener.allow_create) - self.assertTrue(test_listener.allow_get) - self.assertTrue(test_listener.allow_update) + self.assertTrue(test_listener.allow_fetch) + self.assertTrue(test_listener.allow_commit) self.assertTrue(test_listener.allow_delete) self.assertTrue(test_listener.allow_list) diff --git a/openstack/tests/unit/load_balancer/test_load_balancer.py b/openstack/tests/unit/load_balancer/test_load_balancer.py index a6e47a21c..7a96179e4 100644 --- a/openstack/tests/unit/load_balancer/test_load_balancer.py +++ b/openstack/tests/unit/load_balancer/test_load_balancer.py @@ -50,10 +50,10 @@ class TestLoadBalancer(base.TestCase): self.assertEqual('load-balancer', test_load_balancer.service.service_type) self.assertTrue(test_load_balancer.allow_create) - self.assertTrue(test_load_balancer.allow_get) + self.assertTrue(test_load_balancer.allow_fetch) self.assertTrue(test_load_balancer.allow_delete) self.assertTrue(test_load_balancer.allow_list) - self.assertTrue(test_load_balancer.allow_update) + self.assertTrue(test_load_balancer.allow_commit) def test_make_it(self): test_load_balancer = load_balancer.LoadBalancer(**EXAMPLE) diff --git a/openstack/tests/unit/load_balancer/test_member.py b/openstack/tests/unit/load_balancer/test_member.py index cc36c68c9..0d40da371 100644 --- a/openstack/tests/unit/load_balancer/test_member.py +++ b/openstack/tests/unit/load_balancer/test_member.py @@ -42,8 +42,8 @@ class TestPoolMember(base.TestCase): test_member.base_path) self.assertEqual('load-balancer', test_member.service.service_type) self.assertTrue(test_member.allow_create) - self.assertTrue(test_member.allow_get) - self.assertTrue(test_member.allow_update) + self.assertTrue(test_member.allow_fetch) + self.assertTrue(test_member.allow_commit) self.assertTrue(test_member.allow_delete) self.assertTrue(test_member.allow_list) diff --git a/openstack/tests/unit/load_balancer/test_pool.py b/openstack/tests/unit/load_balancer/test_pool.py index 557dec3d5..fe8a81338 100644 --- a/openstack/tests/unit/load_balancer/test_pool.py +++ b/openstack/tests/unit/load_balancer/test_pool.py @@ -48,10 +48,10 @@ class TestPool(base.TestCase): self.assertEqual('load-balancer', test_pool.service.service_type) self.assertTrue(test_pool.allow_create) - self.assertTrue(test_pool.allow_get) + self.assertTrue(test_pool.allow_fetch) self.assertTrue(test_pool.allow_delete) self.assertTrue(test_pool.allow_list) - self.assertTrue(test_pool.allow_update) + self.assertTrue(test_pool.allow_commit) def test_make_it(self): test_pool = pool.Pool(**EXAMPLE) diff --git a/openstack/tests/unit/load_balancer/test_version.py b/openstack/tests/unit/load_balancer/test_version.py index 101238544..e09a57faa 100644 --- a/openstack/tests/unit/load_balancer/test_version.py +++ b/openstack/tests/unit/load_balancer/test_version.py @@ -31,8 +31,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('load-balancer', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/message/test_version.py b/openstack/tests/unit/message/test_version.py index e9501e69a..f9a3669fb 100644 --- a/openstack/tests/unit/message/test_version.py +++ b/openstack/tests/unit/message/test_version.py @@ -31,8 +31,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('messaging', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/message/v2/test_claim.py b/openstack/tests/unit/message/v2/test_claim.py index 9b299ecbc..0ef520990 100644 --- a/openstack/tests/unit/message/v2/test_claim.py +++ b/openstack/tests/unit/message/v2/test_claim.py @@ -49,9 +49,9 @@ class TestClaim(base.TestCase): self.assertEqual("/queues/%(queue_name)s/claims", sot.base_path) self.assertEqual("messaging", sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) def test_make_it(self): sot = claim.Claim.new(**FAKE2) @@ -137,7 +137,7 @@ class TestClaim(base.TestCase): sot = claim.Claim(**FAKE1) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = "queues/%(queue)s/claims/%(claim)s" % { "queue": FAKE1["queue_name"], "claim": FAKE1["id"]} @@ -156,7 +156,7 @@ class TestClaim(base.TestCase): sot = claim.Claim(**FAKE2) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = "queues/%(queue)s/claims/%(claim)s" % { "queue": FAKE2["queue_name"], "claim": FAKE2["id"]} @@ -177,7 +177,7 @@ class TestClaim(base.TestCase): FAKE = copy.deepcopy(FAKE1) sot = claim.Claim(**FAKE1) - res = sot.update(sess) + res = sot.commit(sess) url = "queues/%(queue)s/claims/%(claim)s" % { "queue": FAKE.pop("queue_name"), "claim": FAKE["id"]} @@ -195,7 +195,7 @@ class TestClaim(base.TestCase): FAKE = copy.deepcopy(FAKE2) sot = claim.Claim(**FAKE2) - res = sot.update(sess) + res = sot.commit(sess) url = "queues/%(queue)s/claims/%(claim)s" % { "queue": FAKE.pop("queue_name"), "claim": FAKE["id"]} diff --git a/openstack/tests/unit/message/v2/test_message.py b/openstack/tests/unit/message/v2/test_message.py index 1a876a756..cbee7ea7d 100644 --- a/openstack/tests/unit/message/v2/test_message.py +++ b/openstack/tests/unit/message/v2/test_message.py @@ -54,7 +54,7 @@ class TestMessage(base.TestCase): self.assertEqual('/queues/%(queue_name)s/messages', sot.base_path) self.assertEqual('messaging', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -147,7 +147,7 @@ class TestMessage(base.TestCase): sot = message.Message(**FAKE1) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = 'queues/%(queue)s/messages/%(message)s' % { 'queue': FAKE1['queue_name'], 'message': FAKE1['id']} @@ -166,13 +166,13 @@ class TestMessage(base.TestCase): sot = message.Message(**FAKE1) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = 'queues/%(queue)s/messages/%(message)s' % { 'queue': FAKE2['queue_name'], 'message': FAKE2['id']} sot = message.Message(**FAKE2) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) headers = {'Client-ID': 'OLD_CLIENT_ID', 'X-PROJECT-ID': 'OLD_PROJECT_ID'} sess.get.assert_called_with(url, diff --git a/openstack/tests/unit/message/v2/test_queue.py b/openstack/tests/unit/message/v2/test_queue.py index 187d400fb..c8277aac3 100644 --- a/openstack/tests/unit/message/v2/test_queue.py +++ b/openstack/tests/unit/message/v2/test_queue.py @@ -42,7 +42,7 @@ class TestQueue(base.TestCase): self.assertEqual('/queues', sot.base_path) self.assertEqual('messaging', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -106,7 +106,7 @@ class TestQueue(base.TestCase): sot = queue.Queue(**FAKE1) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = 'queues/%s' % FAKE1['name'] headers = {'Client-ID': 'NEW_CLIENT_ID', @@ -124,7 +124,7 @@ class TestQueue(base.TestCase): sot = queue.Queue(**FAKE2) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = 'queues/%s' % FAKE2['name'] headers = {'Client-ID': 'OLD_CLIENT_ID', diff --git a/openstack/tests/unit/message/v2/test_subscription.py b/openstack/tests/unit/message/v2/test_subscription.py index 5567c9cad..d465a7f05 100644 --- a/openstack/tests/unit/message/v2/test_subscription.py +++ b/openstack/tests/unit/message/v2/test_subscription.py @@ -55,7 +55,7 @@ class TestSubscription(base.TestCase): self.assertEqual("/queues/%(queue_name)s/subscriptions", sot.base_path) self.assertEqual("messaging", sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -122,7 +122,7 @@ class TestSubscription(base.TestCase): sot = subscription.Subscription(**FAKE1) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = "queues/%(queue)s/subscriptions/%(subscription)s" % { "queue": FAKE1["queue_name"], "subscription": FAKE1["id"]} @@ -141,7 +141,7 @@ class TestSubscription(base.TestCase): sot = subscription.Subscription(**FAKE2) sot._translate_response = mock.Mock() - res = sot.get(sess) + res = sot.fetch(sess) url = "queues/%(queue)s/subscriptions/%(subscription)s" % { "queue": FAKE2["queue_name"], "subscription": FAKE2["id"]} diff --git a/openstack/tests/unit/network/test_version.py b/openstack/tests/unit/network/test_version.py index 6f9dec05c..290d93dbf 100644 --- a/openstack/tests/unit/network/test_version.py +++ b/openstack/tests/unit/network/test_version.py @@ -31,8 +31,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_address_scope.py b/openstack/tests/unit/network/v2/test_address_scope.py index a031284f4..4dd4cb0d3 100644 --- a/openstack/tests/unit/network/v2/test_address_scope.py +++ b/openstack/tests/unit/network/v2/test_address_scope.py @@ -33,8 +33,8 @@ class TestAddressScope(base.TestCase): self.assertEqual('/address-scopes', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_agent.py b/openstack/tests/unit/network/v2/test_agent.py index e279905ed..43fe862d2 100644 --- a/openstack/tests/unit/network/v2/test_agent.py +++ b/openstack/tests/unit/network/v2/test_agent.py @@ -43,8 +43,8 @@ class TestAgent(base.TestCase): self.assertEqual('/agents', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -130,8 +130,8 @@ class TestNetworkHostingDHCPAgent(base.TestCase): self.assertEqual('dhcp-agent', net.resource_name) self.assertEqual('network', net.service.service_type) self.assertFalse(net.allow_create) - self.assertTrue(net.allow_get) - self.assertFalse(net.allow_update) + self.assertTrue(net.allow_fetch) + self.assertFalse(net.allow_commit) self.assertFalse(net.allow_delete) self.assertTrue(net.allow_list) @@ -147,6 +147,6 @@ class TestRouterL3Agent(base.TestCase): self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) self.assertTrue(sot.allow_retrieve) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_auto_allocated_topology.py b/openstack/tests/unit/network/v2/test_auto_allocated_topology.py index c9853cfa8..500837949 100644 --- a/openstack/tests/unit/network/v2/test_auto_allocated_topology.py +++ b/openstack/tests/unit/network/v2/test_auto_allocated_topology.py @@ -27,8 +27,8 @@ class TestAutoAllocatedTopology(base.TestCase): self.assertEqual('auto_allocated_topology', topo.resource_key) self.assertEqual('/auto-allocated-topology', topo.base_path) self.assertFalse(topo.allow_create) - self.assertTrue(topo.allow_get) - self.assertFalse(topo.allow_update) + self.assertTrue(topo.allow_fetch) + self.assertFalse(topo.allow_commit) self.assertTrue(topo.allow_delete) self.assertFalse(topo.allow_list) diff --git a/openstack/tests/unit/network/v2/test_availability_zone.py b/openstack/tests/unit/network/v2/test_availability_zone.py index 67576ca9c..21b3e04c5 100644 --- a/openstack/tests/unit/network/v2/test_availability_zone.py +++ b/openstack/tests/unit/network/v2/test_availability_zone.py @@ -32,8 +32,8 @@ class TestAvailabilityZone(base.TestCase): self.assertEqual('/availability_zones', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_extension.py b/openstack/tests/unit/network/v2/test_extension.py index bd968746c..88fe38c39 100644 --- a/openstack/tests/unit/network/v2/test_extension.py +++ b/openstack/tests/unit/network/v2/test_extension.py @@ -33,8 +33,8 @@ class TestExtension(base.TestCase): self.assertEqual('/extensions', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_flavor.py b/openstack/tests/unit/network/v2/test_flavor.py index 024011b22..414edde7d 100644 --- a/openstack/tests/unit/network/v2/test_flavor.py +++ b/openstack/tests/unit/network/v2/test_flavor.py @@ -40,8 +40,8 @@ class TestFlavor(base.TestCase): self.assertEqual('/flavors', flavors.base_path) self.assertEqual('network', flavors.service.service_type) self.assertTrue(flavors.allow_create) - self.assertTrue(flavors.allow_get) - self.assertTrue(flavors.allow_update) + self.assertTrue(flavors.allow_fetch) + self.assertTrue(flavors.allow_commit) self.assertTrue(flavors.allow_delete) self.assertTrue(flavors.allow_list) diff --git a/openstack/tests/unit/network/v2/test_floating_ip.py b/openstack/tests/unit/network/v2/test_floating_ip.py index b708dd5bc..3912733ff 100644 --- a/openstack/tests/unit/network/v2/test_floating_ip.py +++ b/openstack/tests/unit/network/v2/test_floating_ip.py @@ -47,8 +47,8 @@ class TestFloatingIP(base.TestCase): self.assertEqual('/floatingips', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_health_monitor.py b/openstack/tests/unit/network/v2/test_health_monitor.py index 7018ee185..82454aff6 100644 --- a/openstack/tests/unit/network/v2/test_health_monitor.py +++ b/openstack/tests/unit/network/v2/test_health_monitor.py @@ -41,8 +41,8 @@ class TestHealthMonitor(base.TestCase): self.assertEqual('/lbaas/healthmonitors', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_listener.py b/openstack/tests/unit/network/v2/test_listener.py index 55db10895..2181046c2 100644 --- a/openstack/tests/unit/network/v2/test_listener.py +++ b/openstack/tests/unit/network/v2/test_listener.py @@ -41,8 +41,8 @@ class TestListener(base.TestCase): self.assertEqual('/lbaas/listeners', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_load_balancer.py b/openstack/tests/unit/network/v2/test_load_balancer.py index 4283f4241..755bc3437 100644 --- a/openstack/tests/unit/network/v2/test_load_balancer.py +++ b/openstack/tests/unit/network/v2/test_load_balancer.py @@ -41,8 +41,8 @@ class TestLoadBalancer(base.TestCase): self.assertEqual('/lbaas/loadbalancers', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_metering_label.py b/openstack/tests/unit/network/v2/test_metering_label.py index af9d293d5..6e80b3dbb 100644 --- a/openstack/tests/unit/network/v2/test_metering_label.py +++ b/openstack/tests/unit/network/v2/test_metering_label.py @@ -33,8 +33,8 @@ class TestMeteringLabel(base.TestCase): self.assertEqual('/metering/metering-labels', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_metering_label_rule.py b/openstack/tests/unit/network/v2/test_metering_label_rule.py index b6b9a1317..d672ecb02 100644 --- a/openstack/tests/unit/network/v2/test_metering_label_rule.py +++ b/openstack/tests/unit/network/v2/test_metering_label_rule.py @@ -34,8 +34,8 @@ class TestMeteringLabelRule(base.TestCase): self.assertEqual('/metering/metering-label-rules', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_network.py b/openstack/tests/unit/network/v2/test_network.py index 787cdbef1..6974ebacc 100644 --- a/openstack/tests/unit/network/v2/test_network.py +++ b/openstack/tests/unit/network/v2/test_network.py @@ -54,8 +54,8 @@ class TestNetwork(base.TestCase): self.assertEqual('/networks', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -129,7 +129,7 @@ class TestDHCPAgentHostingNetwork(base.TestCase): self.assertEqual('dhcp-network', net.resource_name) self.assertEqual('network', net.service.service_type) self.assertFalse(net.allow_create) - self.assertTrue(net.allow_get) - self.assertFalse(net.allow_update) + self.assertTrue(net.allow_fetch) + self.assertFalse(net.allow_commit) self.assertFalse(net.allow_delete) self.assertTrue(net.allow_list) diff --git a/openstack/tests/unit/network/v2/test_network_ip_availability.py b/openstack/tests/unit/network/v2/test_network_ip_availability.py index 0dbecc1f2..90caacebb 100644 --- a/openstack/tests/unit/network/v2/test_network_ip_availability.py +++ b/openstack/tests/unit/network/v2/test_network_ip_availability.py @@ -48,8 +48,8 @@ class TestNetworkIPAvailability(base.TestCase): self.assertEqual('network_name', sot.name_attribute) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_pool.py b/openstack/tests/unit/network/v2/test_pool.py index 68e949a9b..ac00277a4 100644 --- a/openstack/tests/unit/network/v2/test_pool.py +++ b/openstack/tests/unit/network/v2/test_pool.py @@ -49,8 +49,8 @@ class TestPool(base.TestCase): self.assertEqual('/lbaas/pools', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_pool_member.py b/openstack/tests/unit/network/v2/test_pool_member.py index dd7e9aa01..742609295 100644 --- a/openstack/tests/unit/network/v2/test_pool_member.py +++ b/openstack/tests/unit/network/v2/test_pool_member.py @@ -37,8 +37,8 @@ class TestPoolMember(base.TestCase): self.assertEqual('/lbaas/pools/%(pool_id)s/members', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_port.py b/openstack/tests/unit/network/v2/test_port.py index 2fb241214..9984b3519 100644 --- a/openstack/tests/unit/network/v2/test_port.py +++ b/openstack/tests/unit/network/v2/test_port.py @@ -63,8 +63,8 @@ class TestPort(base.TestCase): self.assertEqual('/ports', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_qos_bandwidth_limit_rule.py b/openstack/tests/unit/network/v2/test_qos_bandwidth_limit_rule.py index cfb77f332..57c53fbdd 100644 --- a/openstack/tests/unit/network/v2/test_qos_bandwidth_limit_rule.py +++ b/openstack/tests/unit/network/v2/test_qos_bandwidth_limit_rule.py @@ -35,8 +35,8 @@ class TestQoSBandwidthLimitRule(base.TestCase): sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_qos_dscp_marking_rule.py b/openstack/tests/unit/network/v2/test_qos_dscp_marking_rule.py index 11132fc70..6320c3ee2 100644 --- a/openstack/tests/unit/network/v2/test_qos_dscp_marking_rule.py +++ b/openstack/tests/unit/network/v2/test_qos_dscp_marking_rule.py @@ -32,8 +32,8 @@ class TestQoSDSCPMarkingRule(base.TestCase): sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_qos_minimum_bandwidth_rule.py b/openstack/tests/unit/network/v2/test_qos_minimum_bandwidth_rule.py index 090e8d198..2e7c48f42 100644 --- a/openstack/tests/unit/network/v2/test_qos_minimum_bandwidth_rule.py +++ b/openstack/tests/unit/network/v2/test_qos_minimum_bandwidth_rule.py @@ -34,8 +34,8 @@ class TestQoSMinimumBandwidthRule(base.TestCase): sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_qos_policy.py b/openstack/tests/unit/network/v2/test_qos_policy.py index 11304db34..b2c96e2a0 100644 --- a/openstack/tests/unit/network/v2/test_qos_policy.py +++ b/openstack/tests/unit/network/v2/test_qos_policy.py @@ -36,8 +36,8 @@ class TestQoSPolicy(base.TestCase): self.assertEqual('/qos/policies', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_qos_rule_type.py b/openstack/tests/unit/network/v2/test_qos_rule_type.py index eb3c12d4b..58df91540 100644 --- a/openstack/tests/unit/network/v2/test_qos_rule_type.py +++ b/openstack/tests/unit/network/v2/test_qos_rule_type.py @@ -44,8 +44,8 @@ class TestQoSRuleType(base.TestCase): self.assertEqual('/qos/rule-types', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_quota.py b/openstack/tests/unit/network/v2/test_quota.py index 00a54f999..81c557dd0 100644 --- a/openstack/tests/unit/network/v2/test_quota.py +++ b/openstack/tests/unit/network/v2/test_quota.py @@ -44,8 +44,8 @@ class TestQuota(base.TestCase): self.assertEqual('/quotas', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -91,8 +91,8 @@ class TestQuotaDefault(base.TestCase): self.assertEqual('/quotas/%(project)s/default', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_rbac_policy.py b/openstack/tests/unit/network/v2/test_rbac_policy.py index f42237a7f..af8aa5d2c 100644 --- a/openstack/tests/unit/network/v2/test_rbac_policy.py +++ b/openstack/tests/unit/network/v2/test_rbac_policy.py @@ -33,8 +33,8 @@ class TestRBACPolicy(base.TestCase): self.assertEqual('/rbac-policies', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_router.py b/openstack/tests/unit/network/v2/test_router.py index 2bc12d26e..5ba0cc272 100644 --- a/openstack/tests/unit/network/v2/test_router.py +++ b/openstack/tests/unit/network/v2/test_router.py @@ -67,8 +67,8 @@ class TestRouter(base.TestCase): self.assertEqual('/routers', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -216,6 +216,6 @@ class TestL3AgentRouters(base.TestCase): self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) self.assertTrue(sot.allow_retrieve) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_security_group.py b/openstack/tests/unit/network/v2/test_security_group.py index 500f090d1..d08a89019 100644 --- a/openstack/tests/unit/network/v2/test_security_group.py +++ b/openstack/tests/unit/network/v2/test_security_group.py @@ -71,8 +71,8 @@ class TestSecurityGroup(base.TestCase): self.assertEqual('/security-groups', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_security_group_rule.py b/openstack/tests/unit/network/v2/test_security_group_rule.py index 5292099c9..fe347b686 100644 --- a/openstack/tests/unit/network/v2/test_security_group_rule.py +++ b/openstack/tests/unit/network/v2/test_security_group_rule.py @@ -42,8 +42,8 @@ class TestSecurityGroupRule(base.TestCase): self.assertEqual('/security-group-rules', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_segment.py b/openstack/tests/unit/network/v2/test_segment.py index e651fd6d6..25cb4c68d 100644 --- a/openstack/tests/unit/network/v2/test_segment.py +++ b/openstack/tests/unit/network/v2/test_segment.py @@ -36,8 +36,8 @@ class TestSegment(base.TestCase): self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_service_profile.py b/openstack/tests/unit/network/v2/test_service_profile.py index e5961b4b9..2e6e26f24 100644 --- a/openstack/tests/unit/network/v2/test_service_profile.py +++ b/openstack/tests/unit/network/v2/test_service_profile.py @@ -35,8 +35,8 @@ class TestServiceProfile(base.TestCase): self.assertEqual('service_profiles', service_profiles.resources_key) self.assertEqual('/service_profiles', service_profiles.base_path) self.assertTrue(service_profiles.allow_create) - self.assertTrue(service_profiles.allow_get) - self.assertTrue(service_profiles.allow_update) + self.assertTrue(service_profiles.allow_fetch) + self.assertTrue(service_profiles.allow_commit) self.assertTrue(service_profiles.allow_delete) self.assertTrue(service_profiles.allow_list) diff --git a/openstack/tests/unit/network/v2/test_service_provider.py b/openstack/tests/unit/network/v2/test_service_provider.py index e3c3448cc..25635a449 100644 --- a/openstack/tests/unit/network/v2/test_service_provider.py +++ b/openstack/tests/unit/network/v2/test_service_provider.py @@ -31,8 +31,8 @@ class TestServiceProvider(base.TestCase): self.assertEqual('/service-providers', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_subnet.py b/openstack/tests/unit/network/v2/test_subnet.py index 9d1224405..a076a8fbc 100644 --- a/openstack/tests/unit/network/v2/test_subnet.py +++ b/openstack/tests/unit/network/v2/test_subnet.py @@ -49,8 +49,8 @@ class TestSubnet(base.TestCase): self.assertEqual('/subnets', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_subnet_pool.py b/openstack/tests/unit/network/v2/test_subnet_pool.py index 7751820c8..975316bf6 100644 --- a/openstack/tests/unit/network/v2/test_subnet_pool.py +++ b/openstack/tests/unit/network/v2/test_subnet_pool.py @@ -44,8 +44,8 @@ class TestSubnetpool(base.TestCase): self.assertEqual('/subnetpools', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_trunk.py b/openstack/tests/unit/network/v2/test_trunk.py index 47abc14a9..ab0674857 100644 --- a/openstack/tests/unit/network/v2/test_trunk.py +++ b/openstack/tests/unit/network/v2/test_trunk.py @@ -40,8 +40,8 @@ class TestQoSPolicy(base.TestCase): self.assertEqual('/trunks', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/network/v2/test_vpn_service.py b/openstack/tests/unit/network/v2/test_vpn_service.py index 662f461ef..981e1186b 100644 --- a/openstack/tests/unit/network/v2/test_vpn_service.py +++ b/openstack/tests/unit/network/v2/test_vpn_service.py @@ -38,8 +38,8 @@ class TestVPNService(base.TestCase): self.assertEqual('/vpn/vpnservices', sot.base_path) self.assertEqual('network', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/object_store/v1/test_account.py b/openstack/tests/unit/object_store/v1/test_account.py index 50f511a0f..4851fb125 100644 --- a/openstack/tests/unit/object_store/v1/test_account.py +++ b/openstack/tests/unit/object_store/v1/test_account.py @@ -37,9 +37,9 @@ class TestAccount(base.TestCase): self.assertIsNone(sot.id) self.assertEqual('/', sot.base_path) self.assertEqual('object-store', sot.service.service_type) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_head) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) self.assertFalse(sot.allow_create) diff --git a/openstack/tests/unit/object_store/v1/test_container.py b/openstack/tests/unit/object_store/v1/test_container.py index 84fa993ce..88075beb6 100644 --- a/openstack/tests/unit/object_store/v1/test_container.py +++ b/openstack/tests/unit/object_store/v1/test_container.py @@ -48,9 +48,9 @@ class TestContainer(base.TestCase): self.assertEqual('name', sot._alternate_id()) self.assertEqual('/', sot.base_path) self.assertEqual('object-store', sot.service.service_type) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_head) @@ -150,9 +150,9 @@ class TestContainer(base.TestCase): sot = container.Container.new(name=self.container) self._test_create_update(sot, sot.create, 'PUT') - def test_update(self): + def test_commit(self): sot = container.Container.new(name=self.container) - self._test_create_update(sot, sot.update, 'POST') + self._test_create_update(sot, sot.commit, 'POST') def test_to_dict_recursion(self): # This test is verifying that circular aliases in a Resource @@ -182,7 +182,7 @@ class TestContainer(base.TestCase): self._test_no_headers(sot, sot.create, 'PUT') self.assert_calls() - def test_update_no_headers(self): + def test_commit_no_headers(self): sot = container.Container.new(name=self.container) - self._test_no_headers(sot, sot.update, 'POST') + self._test_no_headers(sot, sot.commit, 'POST') self.assert_no_calls() diff --git a/openstack/tests/unit/object_store/v1/test_obj.py b/openstack/tests/unit/object_store/v1/test_obj.py index 640523eba..6ffb93b98 100644 --- a/openstack/tests/unit/object_store/v1/test_obj.py +++ b/openstack/tests/unit/object_store/v1/test_obj.py @@ -62,9 +62,9 @@ class TestObject(base_test_object.BaseTestObject): self.assertEqual('name', sot._alternate_id()) self.assertEqual('/%(container)s', sot.base_path) self.assertEqual('object-store', sot.service.service_type) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_head) diff --git a/openstack/tests/unit/orchestration/test_version.py b/openstack/tests/unit/orchestration/test_version.py index 464286dbe..7432d005b 100644 --- a/openstack/tests/unit/orchestration/test_version.py +++ b/openstack/tests/unit/orchestration/test_version.py @@ -31,8 +31,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('orchestration', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/orchestration/v1/test_proxy.py b/openstack/tests/unit/orchestration/v1/test_proxy.py index 9fe788d6f..0fc39487b 100644 --- a/openstack/tests/unit/orchestration/v1/test_proxy.py +++ b/openstack/tests/unit/orchestration/v1/test_proxy.py @@ -110,33 +110,33 @@ class TestOrchestrationProxy(test_proxy_base.TestProxyBase): 'stack_name': stack_name, 'stack_id': stack_id}) - @mock.patch.object(stack_files.StackFiles, 'get') + @mock.patch.object(stack_files.StackFiles, 'fetch') @mock.patch.object(stack.Stack, 'find') - def test_get_stack_files_with_stack_identity(self, mock_find, mock_get): + def test_get_stack_files_with_stack_identity(self, mock_find, mock_fetch): stack_id = '1234' stack_name = 'test_stack' stk = stack.Stack(id=stack_id, name=stack_name) mock_find.return_value = stk - mock_get.return_value = {'file': 'content'} + mock_fetch.return_value = {'file': 'content'} res = self.proxy.get_stack_files('IDENTITY') self.assertEqual({'file': 'content'}, res) mock_find.assert_called_once_with(mock.ANY, 'IDENTITY', ignore_missing=False) - mock_get.assert_called_once_with(self.proxy) + mock_fetch.assert_called_once_with(self.proxy) - @mock.patch.object(stack_files.StackFiles, 'get') - def test_get_stack_files_with_stack_object(self, mock_get): + @mock.patch.object(stack_files.StackFiles, 'fetch') + def test_get_stack_files_with_stack_object(self, mock_fetch): stack_id = '1234' stack_name = 'test_stack' stk = stack.Stack(id=stack_id, name=stack_name) - mock_get.return_value = {'file': 'content'} + mock_fetch.return_value = {'file': 'content'} res = self.proxy.get_stack_files(stk) self.assertEqual({'file': 'content'}, res) - mock_get.assert_called_once_with(self.proxy) + mock_fetch.assert_called_once_with(self.proxy) @mock.patch.object(stack.Stack, 'find') def test_get_stack_template_with_stack_identity(self, mock_find): diff --git a/openstack/tests/unit/orchestration/v1/test_resource.py b/openstack/tests/unit/orchestration/v1/test_resource.py index 9e1968fe0..1e6a01f7c 100644 --- a/openstack/tests/unit/orchestration/v1/test_resource.py +++ b/openstack/tests/unit/orchestration/v1/test_resource.py @@ -47,7 +47,7 @@ class TestResource(base.TestCase): self.assertEqual('orchestration', sot.service.service_type) self.assertFalse(sot.allow_create) self.assertFalse(sot.allow_retrieve) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/orchestration/v1/test_software_config.py b/openstack/tests/unit/orchestration/v1/test_software_config.py index 02dad3152..99c4f2de2 100644 --- a/openstack/tests/unit/orchestration/v1/test_software_config.py +++ b/openstack/tests/unit/orchestration/v1/test_software_config.py @@ -38,8 +38,8 @@ class TestSoftwareConfig(base.TestCase): self.assertEqual('/software_configs', sot.base_path) self.assertEqual('orchestration', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/orchestration/v1/test_software_deployment.py b/openstack/tests/unit/orchestration/v1/test_software_deployment.py index fb242ebeb..1ffb33974 100644 --- a/openstack/tests/unit/orchestration/v1/test_software_deployment.py +++ b/openstack/tests/unit/orchestration/v1/test_software_deployment.py @@ -38,8 +38,8 @@ class TestSoftwareDeployment(base.TestCase): self.assertEqual('/software_deployments', sot.base_path) self.assertEqual('orchestration', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/orchestration/v1/test_stack.py b/openstack/tests/unit/orchestration/v1/test_stack.py index dc1a19b30..e7e7d506f 100644 --- a/openstack/tests/unit/orchestration/v1/test_stack.py +++ b/openstack/tests/unit/orchestration/v1/test_stack.py @@ -60,8 +60,8 @@ class TestStack(base.TestCase): self.assertEqual('/stacks', sot.base_path) self.assertEqual('orchestration', sot.service.service_type) self.assertTrue(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertTrue(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) @@ -97,16 +97,16 @@ class TestStack(base.TestCase): mock_create.assert_called_once_with(sess, prepend_key=False) self.assertEqual(mock_create.return_value, res) - @mock.patch.object(resource.Resource, 'update') - def test_update(self, mock_update): + @mock.patch.object(resource.Resource, 'commit') + def test_commit(self, mock_commit): sess = mock.Mock() sot = stack.Stack(FAKE) - res = sot.update(sess) + res = sot.commit(sess) - mock_update.assert_called_once_with(sess, prepend_key=False, + mock_commit.assert_called_once_with(sess, prepend_key=False, has_body=False) - self.assertEqual(mock_update.return_value, res) + self.assertEqual(mock_commit.return_value, res) def test_check(self): sess = mock.Mock() @@ -118,22 +118,22 @@ class TestStack(base.TestCase): sot._action.assert_called_with(sess, body) - @mock.patch.object(resource.Resource, 'get') - def test_get(self, mock_get): + @mock.patch.object(resource.Resource, 'fetch') + def test_fetch(self, mock_fetch): sess = mock.Mock() sot = stack.Stack(**FAKE) deleted_stack = mock.Mock(id=FAKE_ID, status='DELETE_COMPLETE') normal_stack = mock.Mock(status='CREATE_COMPLETE') - mock_get.side_effect = [ + mock_fetch.side_effect = [ normal_stack, exceptions.NotFoundException(message='oops'), deleted_stack, ] - self.assertEqual(normal_stack, sot.get(sess)) - ex = self.assertRaises(exceptions.NotFoundException, sot.get, sess) + self.assertEqual(normal_stack, sot.fetch(sess)) + ex = self.assertRaises(exceptions.NotFoundException, sot.fetch, sess) self.assertEqual('oops', six.text_type(ex)) - ex = self.assertRaises(exceptions.NotFoundException, sot.get, sess) + ex = self.assertRaises(exceptions.NotFoundException, sot.fetch, sess) self.assertEqual('No stack found for %s' % FAKE_ID, six.text_type(ex)) @@ -146,6 +146,6 @@ class TestStackPreview(base.TestCase): self.assertEqual('/stacks/preview', sot.base_path) self.assertTrue(sot.allow_create) self.assertFalse(sot.allow_list) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) diff --git a/openstack/tests/unit/orchestration/v1/test_stack_environment.py b/openstack/tests/unit/orchestration/v1/test_stack_environment.py index 692dc93cc..2864a4a45 100644 --- a/openstack/tests/unit/orchestration/v1/test_stack_environment.py +++ b/openstack/tests/unit/orchestration/v1/test_stack_environment.py @@ -42,8 +42,8 @@ class TestStackTemplate(base.TestCase): sot = se.StackEnvironment() self.assertEqual('orchestration', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) diff --git a/openstack/tests/unit/orchestration/v1/test_stack_files.py b/openstack/tests/unit/orchestration/v1/test_stack_files.py index 4c4f06f9c..f43a7d936 100644 --- a/openstack/tests/unit/orchestration/v1/test_stack_files.py +++ b/openstack/tests/unit/orchestration/v1/test_stack_files.py @@ -28,8 +28,8 @@ class TestStackFiles(base.TestCase): sot = sf.StackFiles() self.assertEqual('orchestration', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) @@ -55,7 +55,7 @@ class TestStackFiles(base.TestCase): 'stack_id': FAKE['stack_id']}) mock_prepare_request.return_value = req - files = sot.get(sess) + files = sot.fetch(sess) sess.get.assert_called_once_with(req.url) self.assertEqual({'file': 'file-content'}, files) diff --git a/openstack/tests/unit/orchestration/v1/test_stack_template.py b/openstack/tests/unit/orchestration/v1/test_stack_template.py index 7ea88142b..51c03cbf4 100644 --- a/openstack/tests/unit/orchestration/v1/test_stack_template.py +++ b/openstack/tests/unit/orchestration/v1/test_stack_template.py @@ -42,8 +42,8 @@ class TestStackTemplate(base.TestCase): sot = stack_template.StackTemplate() self.assertEqual('orchestration', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertTrue(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertTrue(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) diff --git a/openstack/tests/unit/orchestration/v1/test_template.py b/openstack/tests/unit/orchestration/v1/test_template.py index 7cc91f3da..966560239 100644 --- a/openstack/tests/unit/orchestration/v1/test_template.py +++ b/openstack/tests/unit/orchestration/v1/test_template.py @@ -37,8 +37,8 @@ class TestTemplate(base.TestCase): sot = template.Template() self.assertEqual('orchestration', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) diff --git a/openstack/tests/unit/test_proxy.py b/openstack/tests/unit/test_proxy.py index 54bc6be19..e1520ed97 100644 --- a/openstack/tests/unit/test_proxy.py +++ b/openstack/tests/unit/test_proxy.py @@ -24,7 +24,7 @@ class DeleteableResource(resource.Resource): class UpdateableResource(resource.Resource): - allow_update = True + allow_commit = True class CreateableResource(resource.Resource): @@ -241,7 +241,7 @@ class TestProxyUpdate(base.TestCase): self.fake_result = "fake_result" self.res = mock.Mock(spec=UpdateableResource) - self.res.update = mock.Mock(return_value=self.fake_result) + self.res.commit = mock.Mock(return_value=self.fake_result) self.sot = proxy.Proxy(self.session) @@ -254,13 +254,13 @@ class TestProxyUpdate(base.TestCase): self.assertEqual(rv, self.fake_result) self.res._update.assert_called_once_with(**self.attrs) - self.res.update.assert_called_once_with(self.sot) + self.res.commit.assert_called_once_with(self.sot) def test_update_id(self): rv = self.sot._update(UpdateableResource, self.fake_id, **self.attrs) self.assertEqual(rv, self.fake_result) - self.res.update.assert_called_once_with(self.sot) + self.res.commit.assert_called_once_with(self.sot) class TestProxyCreate(base.TestCase): @@ -299,7 +299,7 @@ class TestProxyGet(base.TestCase): self.fake_result = "fake_result" self.res = mock.Mock(spec=RetrieveableResource) self.res.id = self.fake_id - self.res.get = mock.Mock(return_value=self.fake_result) + self.res.fetch = mock.Mock(return_value=self.fake_result) self.sot = proxy.Proxy(self.session) RetrieveableResource.new = mock.Mock(return_value=self.res) @@ -307,8 +307,9 @@ class TestProxyGet(base.TestCase): def test_get_resource(self): rv = self.sot._get(RetrieveableResource, self.res) - self.res.get.assert_called_with(self.sot, requires_id=True, - error_message=mock.ANY) + self.res.fetch.assert_called_with( + self.sot, requires_id=True, + error_message=mock.ANY) self.assertEqual(rv, self.fake_result) def test_get_resource_with_args(self): @@ -316,20 +317,22 @@ class TestProxyGet(base.TestCase): rv = self.sot._get(RetrieveableResource, self.res, **args) self.res._update.assert_called_once_with(**args) - self.res.get.assert_called_with(self.sot, requires_id=True, - error_message=mock.ANY) + self.res.fetch.assert_called_with( + self.sot, requires_id=True, + error_message=mock.ANY) self.assertEqual(rv, self.fake_result) def test_get_id(self): rv = self.sot._get(RetrieveableResource, self.fake_id) RetrieveableResource.new.assert_called_with(id=self.fake_id) - self.res.get.assert_called_with(self.sot, requires_id=True, - error_message=mock.ANY) + self.res.fetch.assert_called_with( + self.sot, requires_id=True, + error_message=mock.ANY) self.assertEqual(rv, self.fake_result) def test_get_not_found(self): - self.res.get.side_effect = exceptions.NotFoundException( + self.res.fetch.side_effect = exceptions.NotFoundException( message="test", http_status=404) self.assertRaisesRegex( diff --git a/openstack/tests/unit/test_proxy_base.py b/openstack/tests/unit/test_proxy_base.py index ed2d79948..c2c0dab97 100644 --- a/openstack/tests/unit/test_proxy_base.py +++ b/openstack/tests/unit/test_proxy_base.py @@ -145,8 +145,9 @@ class TestProxyBase(base.TestCase): with mock.patch(patch_target, autospec=True) as res: proxy._get_resource = mock.Mock(return_value=res) proxy._get(resource_type) - res.get.assert_called_once_with(proxy, requires_id=True, - error_message=mock.ANY) + res.fetch.assert_called_once_with( + proxy, requires_id=True, + error_message=mock.ANY) def verify_head(self, test_method, resource_type, mock_method="openstack.proxy.Proxy._head", diff --git a/openstack/tests/unit/test_resource.py b/openstack/tests/unit/test_resource.py index df5f70eb5..de7e6d950 100644 --- a/openstack/tests/unit/test_resource.py +++ b/openstack/tests/unit/test_resource.py @@ -421,12 +421,12 @@ class TestResource(base.TestCase): self.assertEqual(uri, sot._uri.dirty) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertFalse(sot.allow_list) self.assertFalse(sot.allow_head) - self.assertEqual('PUT', sot.update_method) + self.assertEqual('PUT', sot.commit_method) self.assertEqual('POST', sot.create_method) def test_repr(self): @@ -909,8 +909,8 @@ class TestResource(base.TestCase): def test_cant_do_anything(self): class Test(resource.Resource): allow_create = False - allow_get = False - allow_update = False + allow_fetch = False + allow_commit = False allow_delete = False allow_head = False allow_list = False @@ -920,7 +920,7 @@ class TestResource(base.TestCase): # The first argument to all of these operations is the session, # but we raise before we get to it so just pass anything in. self.assertRaises(exceptions.MethodNotSupported, sot.create, "") - self.assertRaises(exceptions.MethodNotSupported, sot.get, "") + self.assertRaises(exceptions.MethodNotSupported, sot.fetch, "") self.assertRaises(exceptions.MethodNotSupported, sot.delete, "") self.assertRaises(exceptions.MethodNotSupported, sot.head, "") @@ -933,7 +933,7 @@ class TestResource(base.TestCase): # if the call can be made, so fake a dirty list. sot._body = mock.Mock() sot._body.dirty = mock.Mock(return_value={"x": "y"}) - self.assertRaises(exceptions.MethodNotSupported, sot.update, "") + self.assertRaises(exceptions.MethodNotSupported, sot.commit, "") class TestResourceActions(base.TestCase): @@ -949,9 +949,9 @@ class TestResourceActions(base.TestCase): base_path = self.base_path resources_key = 'resources' allow_create = True - allow_get = True + allow_fetch = True allow_head = True - allow_update = True + allow_commit = True allow_delete = True allow_list = True @@ -1037,8 +1037,8 @@ class TestResourceActions(base.TestCase): self._test_create(Test, requires_id=False, prepend_key=True) - def test_get(self): - result = self.sot.get(self.session) + def test_fetch(self): + result = self.sot.fetch(self.session) self.sot._prepare_request.assert_called_once_with(requires_id=True) self.session.get.assert_called_once_with( @@ -1048,18 +1048,18 @@ class TestResourceActions(base.TestCase): self.sot._translate_response.assert_called_once_with(self.response) self.assertEqual(result, self.sot) - def test_get_with_microversion(self): + def test_fetch_with_microversion(self): class Test(resource.Resource): service = self.service_name base_path = self.base_path - allow_get = True + allow_fetch = True _max_microversion = '1.42' sot = Test(id='id') sot._prepare_request = mock.Mock(return_value=self.request) sot._translate_response = mock.Mock() - result = sot.get(self.session) + result = sot.fetch(self.session) sot._prepare_request.assert_called_once_with(requires_id=True) self.session.get.assert_called_once_with( @@ -1069,8 +1069,8 @@ class TestResourceActions(base.TestCase): sot._translate_response.assert_called_once_with(self.response) self.assertEqual(result, sot) - def test_get_not_requires_id(self): - result = self.sot.get(self.session, False) + def test_fetch_not_requires_id(self): + result = self.sot.fetch(self.session, False) self.sot._prepare_request.assert_called_once_with(requires_id=False) self.session.get.assert_called_once_with( @@ -1117,31 +1117,31 @@ class TestResourceActions(base.TestCase): self.response, has_body=False) self.assertEqual(result, sot) - def _test_update(self, update_method='PUT', prepend_key=True, + def _test_commit(self, commit_method='PUT', prepend_key=True, has_body=True, microversion=None): - self.sot.update_method = update_method + self.sot.commit_method = commit_method # Need to make sot look dirty so we can attempt an update self.sot._body = mock.Mock() self.sot._body.dirty = mock.Mock(return_value={"x": "y"}) - self.sot.update(self.session, prepend_key=prepend_key, + self.sot.commit(self.session, prepend_key=prepend_key, has_body=has_body) self.sot._prepare_request.assert_called_once_with( prepend_key=prepend_key) - if update_method == 'PATCH': + if commit_method == 'PATCH': self.session.patch.assert_called_once_with( self.request.url, json=self.request.body, headers=self.request.headers, microversion=microversion) - elif update_method == 'POST': + elif commit_method == 'POST': self.session.post.assert_called_once_with( self.request.url, json=self.request.body, headers=self.request.headers, microversion=microversion) - elif update_method == 'PUT': + elif commit_method == 'PUT': self.session.put.assert_called_once_with( self.request.url, json=self.request.body, headers=self.request.headers, @@ -1151,20 +1151,20 @@ class TestResourceActions(base.TestCase): self.sot._translate_response.assert_called_once_with( self.response, has_body=has_body) - def test_update_put(self): - self._test_update(update_method='PUT', prepend_key=True, has_body=True) + def test_commit_put(self): + self._test_commit(commit_method='PUT', prepend_key=True, has_body=True) - def test_update_patch(self): - self._test_update( - update_method='PATCH', prepend_key=False, has_body=False) + def test_commit_patch(self): + self._test_commit( + commit_method='PATCH', prepend_key=False, has_body=False) - def test_update_not_dirty(self): + def test_commit_not_dirty(self): self.sot._body = mock.Mock() self.sot._body.dirty = dict() self.sot._header = mock.Mock() self.sot._header.dirty = dict() - self.sot.update(self.session) + self.sot.commit(self.session) self.session.put.assert_not_called() @@ -1879,7 +1879,7 @@ class TestResourceFind(base.TestCase): @classmethod def existing(cls, **kwargs): mock_match = mock.Mock() - mock_match.get.return_value = value + mock_match.fetch.return_value = value return mock_match result = Test.find("session", "name") @@ -1990,11 +1990,11 @@ class TestWaitForStatus(base.TestCase): assert not kwargs, 'Unexpected keyword arguments: %s' % kwargs resources = [] for status in statuses: - res = mock.Mock(spec=['id', 'get', attribute]) + res = mock.Mock(spec=['id', 'fetch', attribute]) setattr(res, attribute, status) resources.append(res) for index, res in enumerate(resources[:-1]): - res.get.return_value = resources[index + 1] + res.fetch.return_value = resources[index + 1] return resources def test_status_match(self): @@ -2089,7 +2089,7 @@ class TestWaitForDelete(base.TestCase): response.headers = {} response.status_code = 404 res = mock.Mock() - res.get.side_effect = [ + res.fetch.side_effect = [ None, None, exceptions.NotFoundException('Not Found', response)] @@ -2100,7 +2100,7 @@ class TestWaitForDelete(base.TestCase): def test_timeout(self): res = mock.Mock() res.status = 'ACTIVE' - res.get.return_value = res + res.fetch.return_value = res self.assertRaises( exceptions.ResourceTimeout, @@ -2118,8 +2118,8 @@ class TestAssertMicroversionFor(base.TestCase): self.assertEqual( '1.42', - self.res._assert_microversion_for(self.session, 'get', '1.6')) - mock_get_ver.assert_called_once_with(self.res, self.session, 'get') + self.res._assert_microversion_for(self.session, 'fetch', '1.6')) + mock_get_ver.assert_called_once_with(self.res, self.session, 'fetch') def test_incompatible(self, mock_get_ver): mock_get_ver.return_value = '1.1' @@ -2127,8 +2127,8 @@ class TestAssertMicroversionFor(base.TestCase): self.assertRaisesRegex(exceptions.NotSupported, '1.6 is required, but 1.1 will be used', self.res._assert_microversion_for, - self.session, 'get', '1.6') - mock_get_ver.assert_called_once_with(self.res, self.session, 'get') + self.session, 'fetch', '1.6') + mock_get_ver.assert_called_once_with(self.res, self.session, 'fetch') def test_custom_message(self, mock_get_ver): mock_get_ver.return_value = '1.1' @@ -2136,9 +2136,9 @@ class TestAssertMicroversionFor(base.TestCase): self.assertRaisesRegex(exceptions.NotSupported, 'boom.*1.6 is required, but 1.1 will be used', self.res._assert_microversion_for, - self.session, 'get', '1.6', + self.session, 'fetch', '1.6', error_message='boom') - mock_get_ver.assert_called_once_with(self.res, self.session, 'get') + mock_get_ver.assert_called_once_with(self.res, self.session, 'fetch') def test_none(self, mock_get_ver): mock_get_ver.return_value = None @@ -2146,5 +2146,5 @@ class TestAssertMicroversionFor(base.TestCase): self.assertRaisesRegex(exceptions.NotSupported, '1.6 is required, but the default version', self.res._assert_microversion_for, - self.session, 'get', '1.6') - mock_get_ver.assert_called_once_with(self.res, self.session, 'get') + self.session, 'fetch', '1.6') + mock_get_ver.assert_called_once_with(self.res, self.session, 'fetch') diff --git a/openstack/tests/unit/workflow/test_execution.py b/openstack/tests/unit/workflow/test_execution.py index a79a2b463..d11b5cfa8 100644 --- a/openstack/tests/unit/workflow/test_execution.py +++ b/openstack/tests/unit/workflow/test_execution.py @@ -38,7 +38,7 @@ class TestExecution(base.TestCase): self.assertEqual('executions', sot.resources_key) self.assertEqual('/executions', sot.base_path) self.assertEqual('workflowv2', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_create) self.assertTrue(sot.allow_delete) diff --git a/openstack/tests/unit/workflow/test_version.py b/openstack/tests/unit/workflow/test_version.py index 647418099..e349d438d 100644 --- a/openstack/tests/unit/workflow/test_version.py +++ b/openstack/tests/unit/workflow/test_version.py @@ -31,8 +31,8 @@ class TestVersion(base.TestCase): self.assertEqual('/', sot.base_path) self.assertEqual('workflowv2', sot.service.service_type) self.assertFalse(sot.allow_create) - self.assertFalse(sot.allow_get) - self.assertFalse(sot.allow_update) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) diff --git a/openstack/tests/unit/workflow/test_workflow.py b/openstack/tests/unit/workflow/test_workflow.py index b9d457a2a..f1af93f89 100644 --- a/openstack/tests/unit/workflow/test_workflow.py +++ b/openstack/tests/unit/workflow/test_workflow.py @@ -33,7 +33,7 @@ class TestWorkflow(base.TestCase): self.assertEqual('workflows', sot.resources_key) self.assertEqual('/workflows', sot.base_path) self.assertEqual('workflowv2', sot.service.service_type) - self.assertTrue(sot.allow_get) + self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_create) self.assertTrue(sot.allow_delete) diff --git a/openstack/workflow/v2/execution.py b/openstack/workflow/v2/execution.py index 01287eacb..697410de1 100644 --- a/openstack/workflow/v2/execution.py +++ b/openstack/workflow/v2/execution.py @@ -23,7 +23,7 @@ class Execution(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True _query_mapping = resource.QueryParameters( diff --git a/openstack/workflow/v2/workflow.py b/openstack/workflow/v2/workflow.py index c98237cc1..3214a6b64 100644 --- a/openstack/workflow/v2/workflow.py +++ b/openstack/workflow/v2/workflow.py @@ -23,7 +23,7 @@ class Workflow(resource.Resource): # capabilities allow_create = True allow_list = True - allow_get = True + allow_fetch = True allow_delete = True _query_mapping = resource.QueryParameters( diff --git a/releasenotes/notes/rename-resource-methods-5f2a716b08156765.yaml b/releasenotes/notes/rename-resource-methods-5f2a716b08156765.yaml new file mode 100644 index 000000000..071371c73 --- /dev/null +++ b/releasenotes/notes/rename-resource-methods-5f2a716b08156765.yaml @@ -0,0 +1,12 @@ +--- +upgrade: + - | + ``openstack.resource.Resource.get`` has been renamed to + ``openstack.resource.Resource.fetch`` to prevent conflicting with a + ``dict`` method of the same name. While most consumer code is unlikely + to call this method directly, this is a breaking change. + - | + ``openstack.resource.Resource.update`` has been renamed to + ``openstack.resource.Resource.commit`` to prevent conflicting with a + ``dict`` method of the same name. While most consumer code is unlikely + to call this method directly, this is a breaking change.