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):
</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()
<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>
</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>
</clone-id>
</results>"""
elif 'clone-list-status' == api:
- body = """<results status="passed">
+ body = """<results status="passed">
<status>
<ops-info>
<clone-state>completed</clone-state>
</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()