Merge "Add available params in metering labels client's comment"
diff --git a/requirements.txt b/requirements.txt
index 84be219..216dd50 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,11 +10,11 @@
 testrepository>=0.0.18 # Apache-2.0/BSD
 pyOpenSSL>=0.14 # Apache-2.0
 oslo.concurrency>=3.8.0 # Apache-2.0
-oslo.config>=3.10.0 # Apache-2.0
+oslo.config>=3.12.0 # Apache-2.0
 oslo.i18n>=2.1.0 # Apache-2.0
 oslo.log>=1.14.0 # Apache-2.0
 oslo.serialization>=1.10.0 # Apache-2.0
-oslo.utils>=3.14.0 # Apache-2.0
+oslo.utils>=3.15.0 # Apache-2.0
 six>=1.9.0 # MIT
 fixtures>=3.0.0 # Apache-2.0/BSD
 testscenarios>=0.4 # Apache-2.0/BSD
diff --git a/tempest/api/data_processing/base.py b/tempest/api/data_processing/base.py
index decccf3..d5ba76c 100644
--- a/tempest/api/data_processing/base.py
+++ b/tempest/api/data_processing/base.py
@@ -349,7 +349,7 @@
             return None
 
         for plugin in CONF.data_processing_feature_enabled.plugins:
-            if plugin in DEFAULT_TEMPLATES.keys():
+            if plugin in DEFAULT_TEMPLATES:
                 break
         else:
             plugin = ''
diff --git a/tempest/api/orchestration/stacks/test_soft_conf.py b/tempest/api/orchestration/stacks/test_soft_conf.py
index 6a4e2b9..aa0b46a 100644
--- a/tempest/api/orchestration/stacks/test_soft_conf.py
+++ b/tempest/api/orchestration/stacks/test_soft_conf.py
@@ -45,7 +45,7 @@
 
     def _validate_config(self, configuration, api_config):
         # Assert all expected keys are present with matching data
-        for k in configuration.keys():
+        for k in configuration:
             self.assertEqual(configuration[k],
                              api_config['software_config'][k])
 
diff --git a/tempest/cmd/cleanup.py b/tempest/cmd/cleanup.py
index 80de6f5..af86fe3 100644
--- a/tempest/cmd/cleanup.py
+++ b/tempest/cmd/cleanup.py
@@ -106,7 +106,7 @@
         self._load_json()
 
     def _cleanup(self):
-        print ("Begin cleanup")
+        print("Begin cleanup")
         is_dry_run = self.options.dry_run
         is_preserve = not self.options.delete_tempest_conf_objects
         is_save_state = False
@@ -124,7 +124,7 @@
                   'is_save_state': is_save_state}
         tenant_service = cleanup_service.TenantService(admin_mgr, **kwargs)
         tenants = tenant_service.list()
-        print ("Process %s tenants" % len(tenants))
+        print("Process %s tenants" % len(tenants))
 
         # Loop through list of tenants and clean them up.
         for tenant in tenants:
@@ -155,7 +155,7 @@
             self._remove_admin_role(tenant_id)
 
     def _clean_tenant(self, tenant):
-        print ("Cleaning tenant:  %s " % tenant['name'])
+        print("Cleaning tenant:  %s " % tenant['name'])
         is_dry_run = self.options.dry_run
         dry_run_data = self.dry_run_data
         is_preserve = not self.options.delete_tempest_conf_objects
@@ -266,7 +266,7 @@
             return False
 
     def _init_state(self):
-        print ("Initializing saved state.")
+        print("Initializing saved state.")
         data = {}
         admin_mgr = self.admin_mgr
         kwargs = {'data': data,
diff --git a/tempest/cmd/main.py b/tempest/cmd/main.py
index acd97a8..641d11c 100644
--- a/tempest/cmd/main.py
+++ b/tempest/cmd/main.py
@@ -26,7 +26,7 @@
     def __init__(self):
         super(Main, self).__init__(
             description='Tempest cli application',
-            version=version.VersionInfo('tempest').version_string(),
+            version=version.VersionInfo('tempest').version_string_with_vcs(),
             command_manager=commandmanager.CommandManager('tempest.cm'),
             deferred_help=True,
             )
diff --git a/tempest/cmd/workspace.py b/tempest/cmd/workspace.py
index cc82284..6e4b9b4 100644
--- a/tempest/cmd/workspace.py
+++ b/tempest/cmd/workspace.py
@@ -185,25 +185,35 @@
 
         subparsers = parser.add_subparsers()
 
-        list_parser = subparsers.add_parser('list')
+        list_parser = subparsers.add_parser(
+            'list', help='Outputs the name and path of all known tempest '
+            'workspaces')
         list_parser.set_defaults(list=True)
 
-        register_parser = subparsers.add_parser('register')
+        register_parser = subparsers.add_parser(
+            'register', help='Registers a new tempest workspace via a given '
+            '--name and --path')
         register_parser.add_argument('--name', required=True)
         register_parser.add_argument('--path', required=True)
         register_parser.set_defaults(register=True)
 
-        update_parser = subparsers.add_parser('rename')
+        update_parser = subparsers.add_parser(
+            'rename', help='Renames a tempest workspace from --old-name to '
+            '--new-name')
         update_parser.add_argument('--old-name', required=True)
         update_parser.add_argument('--new-name', required=True)
         update_parser.set_defaults(rename=True)
 
-        move_parser = subparsers.add_parser('move')
+        move_parser = subparsers.add_parser(
+            'move', help='Changes the path of a given tempest workspace '
+            '--name to --path')
         move_parser.add_argument('--name', required=True)
         move_parser.add_argument('--path', required=True)
         move_parser.set_defaults(move=True)
 
-        remove_parser = subparsers.add_parser('remove')
+        remove_parser = subparsers.add_parser(
+            'remove', help='Deletes the entry for a given tempest workspace '
+            '--name')
         remove_parser.add_argument('--name', required=True)
         remove_parser.set_defaults(remove=True)
 
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index bf6c537..1b450ab 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -94,7 +94,7 @@
                           self.router)
 
     def set_resources(self, **kwargs):
-        for key in kwargs.keys():
+        for key in kwargs:
             if hasattr(self, key):
                 setattr(self, key, kwargs[key])
 
diff --git a/tempest/lib/auth.py b/tempest/lib/auth.py
index 425758f..54a7002 100644
--- a/tempest/lib/auth.py
+++ b/tempest/lib/auth.py
@@ -665,7 +665,7 @@
                 msg = ('Cannot have conflicting values for %s and %s' %
                        (key1, key2))
                 raise exceptions.InvalidCredentials(msg)
-        for key in attr.keys():
+        for key in attr:
             if key in self.ATTRIBUTES:
                 setattr(self, key, attr[key])
             else:
diff --git a/tempest/lib/cmd/skip_tracker.py b/tempest/lib/cmd/skip_tracker.py
index f35b14c..d95aa46 100755
--- a/tempest/lib/cmd/skip_tracker.py
+++ b/tempest/lib/cmd/skip_tracker.py
@@ -103,7 +103,7 @@
 
 def get_results(result_dict):
     results = []
-    for bug_no in result_dict.keys():
+    for bug_no in result_dict:
         for method in result_dict[bug_no]:
             results.append((method, bug_no))
     return results
diff --git a/tempest/lib/services/network/ports_client.py b/tempest/lib/services/network/ports_client.py
old mode 100644
new mode 100755
index eba11d3..71f1103
--- a/tempest/lib/services/network/ports_client.py
+++ b/tempest/lib/services/network/ports_client.py
@@ -17,24 +17,49 @@
 class PortsClient(base.BaseNetworkClient):
 
     def create_port(self, **kwargs):
+        """Creates a port on a network.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#createPort
+        """
         uri = '/ports'
         post_data = {'port': kwargs}
         return self.create_resource(uri, post_data)
 
     def update_port(self, port_id, **kwargs):
+        """Updates a port.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#updatePort
+        """
         uri = '/ports/%s' % port_id
         post_data = {'port': kwargs}
         return self.update_resource(uri, post_data)
 
     def show_port(self, port_id, **fields):
+        """Shows details for a port.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#showPort
+        """
         uri = '/ports/%s' % port_id
         return self.show_resource(uri, **fields)
 
     def delete_port(self, port_id):
+        """Deletes a port.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#removePort
+        """
         uri = '/ports/%s' % port_id
         return self.delete_resource(uri)
 
     def list_ports(self, **filters):
+        """Lists ports to which the tenant has access.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2.html#listPorts
+        """
         uri = '/ports'
         return self.list_resources(uri, **filters)
 
diff --git a/tempest/lib/services/network/security_groups_client.py b/tempest/lib/services/network/security_groups_client.py
old mode 100644
new mode 100755
index 0e25339..5c89a6f
--- a/tempest/lib/services/network/security_groups_client.py
+++ b/tempest/lib/services/network/security_groups_client.py
@@ -16,23 +16,48 @@
 class SecurityGroupsClient(base.BaseNetworkClient):
 
     def create_security_group(self, **kwargs):
+        """Creates an OpenStack Networking security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#createSecGroup
+        """
         uri = '/security-groups'
         post_data = {'security_group': kwargs}
         return self.create_resource(uri, post_data)
 
     def update_security_group(self, security_group_id, **kwargs):
+        """Updates a security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#updateSecGroup
+        """
         uri = '/security-groups/%s' % security_group_id
         post_data = {'security_group': kwargs}
         return self.update_resource(uri, post_data)
 
     def show_security_group(self, security_group_id, **fields):
+        """Shows details for a security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#showSecGroup
+        """
         uri = '/security-groups/%s' % security_group_id
         return self.show_resource(uri, **fields)
 
     def delete_security_group(self, security_group_id):
+        """Deletes an OpenStack Networking security group.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#deleteSecGroup
+        """
         uri = '/security-groups/%s' % security_group_id
         return self.delete_resource(uri)
 
     def list_security_groups(self, **filters):
+        """Lists OpenStack Networking security groups.
+
+        Available params: see http://developer.openstack.org/
+                              api-ref-networking-v2-ext.html#listSecGroups
+        """
         uri = '/security-groups'
         return self.list_resources(uri, **filters)
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index cace90b..086b82d 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -74,7 +74,7 @@
         self.assertEqual(aggregate_name, aggregate['name'])
         self.assertEqual(azone, aggregate['availability_zone'])
         self.assertEqual(hosts, aggregate['hosts'])
-        for meta_key in metadata.keys():
+        for meta_key in metadata:
             self.assertIn(meta_key, aggregate['metadata'])
             self.assertEqual(metadata[meta_key],
                              aggregate['metadata'][meta_key])
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index 2beaaa9..925d765 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -249,13 +249,13 @@
             had_errors = True
         sum_runs += process['statistic']['runs']
         sum_fails += process['statistic']['fails']
-        print ("Process %d (%s): Run %d actions (%d failed)" % (
-               process['p_number'],
-               process['action'],
-               process['statistic']['runs'],
-               process['statistic']['fails']))
-    print ("Summary:")
-    print ("Run %d actions (%d failed)" % (sum_runs, sum_fails))
+        print("Process %d (%s): Run %d actions (%d failed)" % (
+            process['p_number'],
+            process['action'],
+            process['statistic']['runs'],
+            process['statistic']['fails']))
+    print("Summary:")
+    print("Run %d actions (%d failed)" % (sum_runs, sum_fails))
 
     if not had_errors and CONF.stress.full_clean_stack:
         LOG.info("cleaning up")
diff --git a/tempest/tests/lib/fake_auth_provider.py b/tempest/tests/lib/fake_auth_provider.py
index 8095453..fa8ab47 100644
--- a/tempest/tests/lib/fake_auth_provider.py
+++ b/tempest/tests/lib/fake_auth_provider.py
@@ -31,5 +31,5 @@
 class FakeCredentials(object):
 
     def __init__(self, creds_dict):
-        for key in creds_dict.keys():
+        for key in creds_dict:
             setattr(self, key, creds_dict[key])
diff --git a/tempest/tests/lib/test_credentials.py b/tempest/tests/lib/test_credentials.py
index b6f2cf6..c910d6d 100644
--- a/tempest/tests/lib/test_credentials.py
+++ b/tempest/tests/lib/test_credentials.py
@@ -99,7 +99,7 @@
 
     def _test_is_not_valid(self, ignore_key):
         creds = self._get_credentials()
-        for attr in self.attributes.keys():
+        for attr in self.attributes:
             if attr == ignore_key:
                 continue
             temp_attr = getattr(creds, attr)
diff --git a/tempest/tests/test_service_clients.py b/tempest/tests/test_service_clients.py
index d0158c7..a559086 100644
--- a/tempest/tests/test_service_clients.py
+++ b/tempest/tests/test_service_clients.py
@@ -77,8 +77,8 @@
         uri = 'fake_uri'
         _manager = service_clients.ServiceClients(creds, identity_uri=uri,
                                                   client_parameters=params)
-        self.assertIn('fake_service1', _manager.parameters.keys())
-        for _key in expeted_params.keys():
+        self.assertIn('fake_service1', _manager.parameters)
+        for _key in expeted_params:
             self.assertIn(_key, _manager.parameters['fake_service1'].keys())
             self.assertEqual(expeted_params[_key],
                              _manager.parameters['fake_service1'].get(_key))
diff --git a/tools/skip_tracker.py b/tools/skip_tracker.py
index b554514..55f41a6 100755
--- a/tools/skip_tracker.py
+++ b/tools/skip_tracker.py
@@ -95,7 +95,7 @@
 
 def get_results(result_dict):
     results = []
-    for bug_no in result_dict.keys():
+    for bug_no in result_dict:
         for method in result_dict[bug_no]:
             results.append((method, bug_no))
     return results