Replace the usage of 'os' with 'os_primary'

Read-only property 'os' has moved to 'os_primary' in version 'Pike'
and will be removed in version 'Queens', so this is to replace
the usage of 'os' with 'os_primary'.

Change-Id: I9f7c13da05a8c4a63529c11aa6213a7269abee6d
diff --git a/doc/source/write_tests.rst b/doc/source/write_tests.rst
index 2363fa6..4e3bfa2 100644
--- a/doc/source/write_tests.rst
+++ b/doc/source/write_tests.rst
@@ -178,16 +178,16 @@
 +-------------------+---------------------+
 | Credentials Entry | Manager Variable    |
 +===================+=====================+
-| primary           | cls.os              |
+| primary           | cls.os_primary      |
 +-------------------+---------------------+
-| admin             | cls.os_adm          |
+| admin             | cls.os_admin        |
 +-------------------+---------------------+
 | alt               | cls.os_alt          |
 +-------------------+---------------------+
 | [$label, $role]   | cls.os_roles_$label |
 +-------------------+---------------------+
 
-By default cls.os is available since it is allocated in the base tempest test
+By default cls.os_primary is available since it is allocated in the base tempest test
 class (located in tempest/test.py). If your TestCase inherits from a different
 direct parent class (it'll still inherit from the BaseTestCase, just not
 directly) be sure to check if that class overrides allocated credentials.
@@ -270,13 +270,13 @@
 
   class TestExampleCase(test.BaseTestCase):
     def test_example_create_server(self):
-      self.os.servers_client.create_server(...)
+      self.os_primary.servers_client.create_server(...)
 
-is all you need to do. As described previously, in the above example the ``self.os``
-is created automatically because the base test class sets the ``credentials``
-attribute to allocate a primary credential set and initializes the client
-manager as ``self.os``. This same access pattern can be used for all of the
-clients in Tempest.
+is all you need to do. As described previously, in the above example the
+``self.os_primary`` is created automatically because the base test class sets the
+``credentials`` attribute to allocate a primary credential set and initializes
+the client manager as ``self.os_primary``. This same access pattern can be used
+for all of the clients in Tempest.
 
 Credentials Objects
 -------------------
@@ -293,7 +293,7 @@
 
   class TestExampleCase(test.BaseTestCase):
     def test_example_create_server(self):
-      credentials = self.os.credentials
+      credentials = self.os_primary.credentials
 
 The credentials object provides access to all of the credential information you
 would need to make API requests. For example, building off the previous
@@ -304,7 +304,7 @@
 
   class TestExampleCase(test.BaseTestCase):
     def test_example_create_server(self):
-      credentials = self.os.credentials
+      credentials = self.os_primary.credentials
       username = credentials.username
       user_id = credentials.user_id
       password = credentials.password
diff --git a/tempest/api/compute/admin/test_auto_allocate_network.py b/tempest/api/compute/admin/test_auto_allocate_network.py
index c4db5e3..ba8a214 100644
--- a/tempest/api/compute/admin/test_auto_allocate_network.py
+++ b/tempest/api/compute/admin/test_auto_allocate_network.py
@@ -151,7 +151,7 @@
         """Tests that no networking is allocated for the server."""
         # create the server with no networking
         server, _ = compute.create_test_server(
-            self.os, networks='none', wait_until='ACTIVE')
+            self.os_primary, networks='none', wait_until='ACTIVE')
         self.addCleanup(self.delete_server, server['id'])
         # get the server ips
         addresses = self.servers_client.list_addresses(
@@ -176,7 +176,7 @@
         # - Third request sees net1 and net2 for the tenant and fails with a
         #   NetworkAmbiguous 400 error.
         _, servers = compute.create_test_server(
-            self.os, networks='auto', wait_until='ACTIVE',
+            self.os_primary, networks='auto', wait_until='ACTIVE',
             min_count=3)
         server_nets = set()
         for server in servers:
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 141b9f3..c9d6f02 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -204,7 +204,7 @@
             kwargs['name'] = data_utils.rand_name(cls.__name__ + "-server")
         tenant_network = cls.get_tenant_network()
         body, servers = compute.create_test_server(
-            cls.os,
+            cls.os_primary,
             validatable,
             validation_resources=cls.validation_resources,
             tenant_network=tenant_network,
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index e50b29a..6c5cc79 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -264,7 +264,8 @@
 
         # create two servers
         _, servers = compute.create_test_server(
-            self.os, tenant_network=network, wait_until='ACTIVE', min_count=2)
+            self.os_primary, tenant_network=network,
+            wait_until='ACTIVE', min_count=2)
         # add our cleanups for the servers since we bypassed the base class
         for server in servers:
             self.addCleanup(self.delete_server, server['id'])
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index 7cbb513..059454d 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -24,7 +24,7 @@
     def test_multiple_create(self):
         tenant_network = self.get_tenant_network()
         body, servers = compute.create_test_server(
-            self.os,
+            self.os_primary,
             wait_until='ACTIVE',
             min_count=2,
             tenant_network=tenant_network)
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 3f33c7b..eace92d 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -224,7 +224,7 @@
 
         tenant_network = self.get_tenant_network()
         body, _ = compute.create_test_server(
-            self.os,
+            self.os_primary,
             tenant_network=tenant_network,
             name=name,
             **kwargs)
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 2116fe8..c25ce4c 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -168,7 +168,7 @@
 
         cls.floating_ips = {}
         cls.tenants = {}
-        cls.primary_tenant = cls.TenantProperties(cls.os)
+        cls.primary_tenant = cls.TenantProperties(cls.os_primary)
         cls.alt_tenant = cls.TenantProperties(cls.os_alt)
         for tenant in [cls.primary_tenant, cls.alt_tenant]:
             cls.tenants[tenant.creds.tenant_id] = tenant