]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix bad indentation in tests
authorEric Harney <eharney@redhat.com>
Mon, 21 Apr 2014 18:41:10 +0000 (14:41 -0400)
committerEric Harney <eharney@redhat.com>
Mon, 21 Apr 2014 18:53:16 +0000 (14:53 -0400)
Remove a number of bad indentation errors flagged
by pylint.

Change-Id: I0a048d96aba09b2f14360ceffb1fe167fb613674

cinder/tests/api/contrib/test_services.py
cinder/tests/test_backup.py
cinder/tests/test_huawei_hvs.py
cinder/tests/test_netapp.py
cinder/tests/test_netapp_nfs.py
cinder/tests/test_netapp_ssc.py
cinder/tests/test_utils.py
cinder/tests/test_windows.py

index ce9a38a0fd195b8e23ef57a3205bb9b51398f671..0f26514351111e19dc485cc7a66fa20ff81fe9e9 100644 (file)
@@ -64,37 +64,37 @@ fake_services_list = [{'binary': 'cinder-scheduler',
 
 
 class FakeRequest(object):
-        environ = {"cinder.context": context.get_admin_context()}
-        GET = {}
+    environ = {"cinder.context": context.get_admin_context()}
+    GET = {}
 
 
 # NOTE(uni): deprecating service request key, binary takes precedence
 # Still keeping service key here for API compatibility sake.
 class FakeRequestWithService(object):
-        environ = {"cinder.context": context.get_admin_context()}
-        GET = {"service": "cinder-volume"}
+    environ = {"cinder.context": context.get_admin_context()}
+    GET = {"service": "cinder-volume"}
 
 
 class FakeRequestWithBinary(object):
-        environ = {"cinder.context": context.get_admin_context()}
-        GET = {"binary": "cinder-volume"}
+    environ = {"cinder.context": context.get_admin_context()}
+    GET = {"binary": "cinder-volume"}
 
 
 class FakeRequestWithHost(object):
-        environ = {"cinder.context": context.get_admin_context()}
-        GET = {"host": "host1"}
+    environ = {"cinder.context": context.get_admin_context()}
+    GET = {"host": "host1"}
 
 
 # NOTE(uni): deprecating service request key, binary takes precedence
 # Still keeping service key here for API compatibility sake.
 class FakeRequestWithHostService(object):
-        environ = {"cinder.context": context.get_admin_context()}
-        GET = {"host": "host1", "service": "cinder-volume"}
+    environ = {"cinder.context": context.get_admin_context()}
+    GET = {"host": "host1", "service": "cinder-volume"}
 
 
 class FakeRequestWithHostBinary(object):
-        environ = {"cinder.context": context.get_admin_context()}
-        GET = {"host": "host1", "binary": "cinder-volume"}
+    environ = {"cinder.context": context.get_admin_context()}
+    GET = {"host": "host1", "binary": "cinder-volume"}
 
 
 def fake_service_get_all(context):
index 6c8ad0fa80e1a612ea7735b83bbc8e3f8fd85863..c7f97fe66295e69ea071be378e85842f8aab9a70 100644 (file)
@@ -37,7 +37,7 @@ LOG = logging.getLogger(__name__)
 
 
 class FakeBackupException(Exception):
-        pass
+    pass
 
 
 class BackupTestCase(test.TestCase):
index 586d3769a8bd5c7513407f6841ac43808313f4db..d1ddfa510c303334e642a76854d35621c4e749de 100644 (file)
@@ -115,13 +115,13 @@ class FakeHVSCommon(rest_common.HVSCommon):
 
         if self.test_normal:
             if url == "/xx/sessions":
-                    data = """{"error":{"code":0},
-                                "data":{"username":"admin",
-                                        "deviceid":"210235G7J20000000000"
-                                       }}"""
+                data = """{"error":{"code":0},
+                            "data":{"username":"admin",
+                                    "deviceid":"210235G7J20000000000"
+                                   }}"""
             if url == "sessions":
-                    data = """{"error":{"code":0},
-                                "data":{"ID":11}}"""
+                data = """{"error":{"code":0},
+                            "data":{"ID":11}}"""
 
             if url == "storagepool":
                 data = """{"error":{"code":0},
index 74c9f9be73d93bcb6e6abbcf67da388b50d445f7..858e8d244c89371fa3dacc4f8466c055d5501602 100644 (file)
@@ -340,89 +340,89 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler):
                 </lun-map-info></attributes-list><num-records>1</num-records>
                 </results>"""
         elif 'lun-map' == api:
-                body = """<results status="passed"><lun-id-assigned>1
-                </lun-id-assigned>
-                </results>"""
+            body = """<results status="passed"><lun-id-assigned>1
+            </lun-id-assigned>
+            </results>"""
         elif 'lun-get-geometry' == api:
-                body = """<results status="passed"><bytes-per-sector>256
-                </bytes-per-sector><cylinders>512</cylinders><max-resize-size>
-                3221225472</max-resize-size><sectors-per-track>512
-                </sectors-per-track><size>2147483648</size>
-                <tracks-per-cylinder>256</tracks-per-cylinder></results>"""
+            body = """<results status="passed"><bytes-per-sector>256
+            </bytes-per-sector><cylinders>512</cylinders><max-resize-size>
+            3221225472</max-resize-size><sectors-per-track>512
+            </sectors-per-track><size>2147483648</size>
+            <tracks-per-cylinder>256</tracks-per-cylinder></results>"""
         elif 'iscsi-service-get-iter' == api:
-                body = """<results status="passed"><attributes-list>
-                <iscsi-service-info>
-                <alias-name>openstack</alias-name>
-                <is-available>true</is-available>
-                <node-name>iqn.1992-08.com.netapp:sn.fa9:vs.105</node-name>
-                <vserver>openstack</vserver></iscsi-service-info>
-                </attributes-list><num-records>1</num-records></results>"""
+            body = """<results status="passed"><attributes-list>
+            <iscsi-service-info>
+            <alias-name>openstack</alias-name>
+            <is-available>true</is-available>
+            <node-name>iqn.1992-08.com.netapp:sn.fa9:vs.105</node-name>
+            <vserver>openstack</vserver></iscsi-service-info>
+            </attributes-list><num-records>1</num-records></results>"""
         elif 'iscsi-interface-get-iter' == api:
-                body = """<results status="passed"><attributes-list>
-                <iscsi-interface-list-entry-info><current-node>
-                fas3170rre-cmode-01
-                </current-node><current-port>e1b-1165</current-port>
-                <interface-name>
-                iscsi_data_if</interface-name>
-                <ip-address>10.63.165.216</ip-address>
-                <ip-port>3260</ip-port><is-interface-enabled>true
-                </is-interface-enabled>
-                <relative-port-id>5</relative-port-id>
-                <tpgroup-name>iscsi_data_if</tpgroup-name>
-                <tpgroup-tag>1038</tpgroup-tag><vserver>
-                openstack</vserver>
-                </iscsi-interface-list-entry-info></attributes-list>
-                <num-records>1</num-records></results>"""
+            body = """<results status="passed"><attributes-list>
+            <iscsi-interface-list-entry-info><current-node>
+            fas3170rre-cmode-01
+            </current-node><current-port>e1b-1165</current-port>
+            <interface-name>
+            iscsi_data_if</interface-name>
+            <ip-address>10.63.165.216</ip-address>
+            <ip-port>3260</ip-port><is-interface-enabled>true
+            </is-interface-enabled>
+            <relative-port-id>5</relative-port-id>
+            <tpgroup-name>iscsi_data_if</tpgroup-name>
+            <tpgroup-tag>1038</tpgroup-tag><vserver>
+            openstack</vserver>
+            </iscsi-interface-list-entry-info></attributes-list>
+            <num-records>1</num-records></results>"""
         elif 'igroup-create' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'igroup-add' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'clone-create' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'lun-unmap' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'system-get-ontapi-version' == api:
-                body = """<results status="passed">
-                            <major-version>1</major-version>
-                            <minor-version>19</minor-version>
-                          </results>"""
+            body = """<results status="passed">
+                        <major-version>1</major-version>
+                        <minor-version>19</minor-version>
+                      </results>"""
         elif 'vserver-get-iter' == api:
-                body = """<results status="passed"><attributes-list>
-                          <vserver-info>
-                          <vserver-name>vserver</vserver-name>
-                          <vserver-type>node</vserver-type>
-                          </vserver-info>
-                          </attributes-list>
-                          <num-records>1</num-records></results>"""
+            body = """<results status="passed"><attributes-list>
+                      <vserver-info>
+                      <vserver-name>vserver</vserver-name>
+                      <vserver-type>node</vserver-type>
+                      </vserver-info>
+                      </attributes-list>
+                      <num-records>1</num-records></results>"""
         elif 'ems-autosupport-log' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'lun-resize' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'lun-get-geometry' == api:
-                body = """<results status="passed">
-                          <size>1</size>
-                          <bytes-per-sector>2</bytes-per-sector>
-                          <sectors-per-track>8</sectors-per-track>
-                          <tracks-per-cylinder>2</tracks-per-cylinder>
-                          <cylinders>4</cylinders>
-                          <max-resize-size>5</max-resize-size>
-                          </results>"""
+            body = """<results status="passed">
+                      <size>1</size>
+                      <bytes-per-sector>2</bytes-per-sector>
+                      <sectors-per-track>8</sectors-per-track>
+                      <tracks-per-cylinder>2</tracks-per-cylinder>
+                      <cylinders>4</cylinders>
+                      <max-resize-size>5</max-resize-size>
+                      </results>"""
         elif 'volume-options-list-info' == api:
-                body = """<results status="passed">
-                          <options>
-                          <option>
-                          <name>compression</name>
-                          <value>off</value>
-                          </option>
-                          </options>
-                          </results>"""
+            body = """<results status="passed">
+                      <options>
+                      <option>
+                      <name>compression</name>
+                      <value>off</value>
+                      </option>
+                      </options>
+                      </results>"""
         elif 'lun-move' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         else:
-                # Unknown API
-                s.send_response(500)
-                s.end_headers
-                return
+            # Unknown API
+            s.send_response(500)
+            s.end_headers
+            return
         s.send_response(200)
         s.send_header("Content-Type", "text/xml; charset=utf-8")
         s.end_headers()
@@ -989,15 +989,15 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler):
     <initiator-groups/>
   </results>"""
         elif 'lun-map' == api:
-                body = """<results status="passed"><lun-id-assigned>1
-                </lun-id-assigned>
-                </results>"""
+            body = """<results status="passed"><lun-id-assigned>1
+            </lun-id-assigned>
+            </results>"""
         elif 'iscsi-node-get-name' == api:
-                body = """<results status="passed">
+            body = """<results status="passed">
     <node-name>iqn.1992-08.com.netapp:sn.135093938</node-name>
   </results>"""
         elif 'iscsi-portal-list-info' == api:
-                body = """<results status="passed">
+            body = """<results status="passed">
     <iscsi-portal-list-entries>
       <iscsi-portal-list-entry-info>
         <ip-address>10.61.176.156</ip-address>
@@ -1008,11 +1008,11 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler):
     </iscsi-portal-list-entries>
   </results>"""
         elif 'igroup-create' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'igroup-add' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'clone-start' == api:
-                body = """<results status="passed">
+            body = """<results status="passed">
     <clone-id>
       <clone-id-info>
         <volume-uuid>2d50ecf4-c288-11e0-9282-00a09825b3b5</volume-uuid>
@@ -1021,7 +1021,7 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler):
     </clone-id>
   </results>"""
         elif 'clone-list-status' == api:
-                body = """<results status="passed">
+            body = """<results status="passed">
     <status>
       <ops-info>
         <clone-state>completed</clone-state>
@@ -1029,43 +1029,43 @@ class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler):
     </status>
   </results>"""
         elif 'lun-unmap' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'system-get-ontapi-version' == api:
-                body = """<results status="passed">
-                            <major-version>1</major-version>
-                            <minor-version>8</minor-version>
-                          </results>"""
+            body = """<results status="passed">
+                        <major-version>1</major-version>
+                        <minor-version>8</minor-version>
+                      </results>"""
         elif 'lun-set-space-reservation-info' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'ems-autosupport-log' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'lun-resize' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         elif 'lun-get-geometry' == api:
-                body = """<results status="passed">
-                          <size>1</size>
-                          <bytes-per-sector>2</bytes-per-sector>
-                          <sectors-per-track>8</sectors-per-track>
-                          <tracks-per-cylinder>2</tracks-per-cylinder>
-                          <cylinders>4</cylinders>
-                          <max-resize-size>5</max-resize-size>
-                          </results>"""
+            body = """<results status="passed">
+                      <size>1</size>
+                      <bytes-per-sector>2</bytes-per-sector>
+                      <sectors-per-track>8</sectors-per-track>
+                      <tracks-per-cylinder>2</tracks-per-cylinder>
+                      <cylinders>4</cylinders>
+                      <max-resize-size>5</max-resize-size>
+                      </results>"""
         elif 'volume-options-list-info' == api:
-                body = """<results status="passed">
-                          <options>
-                          <option>
-                          <name>compression</name>
-                          <value>off</value>
-                          </option>
-                          </options>
-                          </results>"""
+            body = """<results status="passed">
+                      <options>
+                      <option>
+                      <name>compression</name>
+                      <value>off</value>
+                      </option>
+                      </options>
+                      </results>"""
         elif 'lun-move' == api:
-                body = """<results status="passed"/>"""
+            body = """<results status="passed"/>"""
         else:
-                # Unknown API
-                s.send_response(500)
-                s.end_headers
-                return
+            # Unknown API
+            s.send_response(500)
+            s.end_headers
+            return
         s.send_response(200)
         s.send_header("Content-Type", "text/xml; charset=utf-8")
         s.end_headers()
index f5de6b1ef851aa0316d9f6d359fa6450785f6f78..db25043e51e7559825aa44217d074fb0c9c44662 100644 (file)
@@ -357,7 +357,7 @@ class NetappDirectCmodeNfsDriverTestCase(test.TestCase):
         drv._mounted_shares.remove('testshare')
 
         if (share == 'testshare' and file_name == 'img-cache-id'):
-                pass
+            pass
         else:
             LOG.warn(_("Share %(share)s and file name %(file_name)s")
                      % {'share': share, 'file_name': file_name})
index ad2f3172655b5cb6a4c3c79282e97a5451d084e7..8fd26c3d05507b5457bf918223cc583217e6efd5 100644 (file)
@@ -204,30 +204,30 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler):
                 </attributes-list>
                 <num-records>4</num-records></results>"""
         elif 'aggr-options-list-info' == localname:
-                body = """<results status="passed">
-                             <options>
-                             <aggr-option-info>
-                             <name>ha_policy</name>
-                             <value>cfo</value>
-                             </aggr-option-info>
-                             <aggr-option-info>
-                             <name>raidtype</name>
-                             <value>raid_dp</value>
-                             </aggr-option-info>
-                             </options>
-                             </results>"""
+            body = """<results status="passed">
+                         <options>
+                         <aggr-option-info>
+                         <name>ha_policy</name>
+                         <value>cfo</value>
+                         </aggr-option-info>
+                         <aggr-option-info>
+                         <name>raidtype</name>
+                         <value>raid_dp</value>
+                         </aggr-option-info>
+                         </options>
+                         </results>"""
         elif 'sis-get-iter' == localname:
-                body = """<results status="passed">
-                             <attributes-list>
-                             <sis-status-info>
-                             <path>/vol/iscsi</path>
-                             <is-compression-enabled>
-                             true
-                             </is-compression-enabled>
-                             <state>enabled</state>
-                             </sis-status-info>
-                             </attributes-list>
-                             </results>"""
+            body = """<results status="passed">
+                         <attributes-list>
+                         <sis-status-info>
+                         <path>/vol/iscsi</path>
+                         <is-compression-enabled>
+                         true
+                         </is-compression-enabled>
+                         <state>enabled</state>
+                         </sis-status-info>
+                         </attributes-list>
+                         </results>"""
         elif 'storage-disk-get-iter' == localname:
             body = """<results status="passed">
                              <attributes-list>
@@ -239,10 +239,10 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler):
                              </attributes-list>
                              </results>"""
         else:
-                # Unknown API
-                s.send_response(500)
-                s.end_headers
-                return
+            # Unknown API
+            s.send_response(500)
+            s.end_headers
+            return
         s.send_response(200)
         s.send_header("Content-Type", "text/xml; charset=utf-8")
         s.end_headers()
index 7c5f27eff262a85ae64cfd01e55a68689ccbd7c6..64d9140365dacb70959b9ac74c39cfa4f1854384 100644 (file)
@@ -551,8 +551,8 @@ class GenericUtilsTestCase(test.TestCase):
     def test_get_file_mode(self, mock_stat):
 
         class stat_result:
-                    st_mode = 0o777
-                    st_gid = 33333
+            st_mode = 0o777
+            st_gid = 33333
 
         test_file = '/var/tmp/made_up_file'
         mock_stat.return_value = stat_result
@@ -564,8 +564,8 @@ class GenericUtilsTestCase(test.TestCase):
     def test_get_file_gid(self, mock_stat):
 
         class stat_result:
-                    st_mode = 0o777
-                    st_gid = 33333
+            st_mode = 0o777
+            st_gid = 33333
 
         test_file = '/var/tmp/made_up_file'
         mock_stat.return_value = stat_result
index 0aa8d80e9e1383b7717ff415cac6d4976c965e79..524a4d02e95623941fbef76ff3ad0c80eadd3169 100644 (file)
@@ -74,8 +74,8 @@ class TestWindowsDriver(test.TestCase):
         windows_utils.WindowsUtils.__init__ = fake_wutils__init__
 
     def fake_local_path(self, volume):
-            return os.path.join(CONF.windows_iscsi_lun_path,
-                                str(volume['name']) + ".vhd")
+        return os.path.join(CONF.windows_iscsi_lun_path,
+                            str(volume['name']) + ".vhd")
 
     def test_check_for_setup_errors(self):
         mox = self._mox