Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Generated from 6c44f3d7c5da632581c3157cc7241568cdf9e94b
fix more errors
  • Loading branch information
AutorestCI committed Jul 12, 2019
commit 289cdd149b67479b4ddf9de4d44f2f638c43d1b3
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ def delete(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: object or ClientRawResponse if raw=true
:rtype: object or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand All @@ -220,6 +220,7 @@ def delete(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -236,7 +237,15 @@ def delete(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'}
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ def delete(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:return: object or ClientRawResponse if raw=true
:rtype: object or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand All @@ -250,6 +250,7 @@ def delete(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -266,9 +267,17 @@ def delete(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 204:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'}

def get_properties(
Expand Down Expand Up @@ -866,6 +875,7 @@ def _failover_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -882,10 +892,19 @@ def _failover_initial(
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('object', response)
if response.status_code == 202:
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

def failover(
self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Failover request can be triggered for a storage account in case of
Expand All @@ -905,10 +924,10 @@ def failover(
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:return: An instance of LROPoller that returns object or
ClientRawResponse<object> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._failover_initial(
Expand All @@ -920,10 +939,14 @@ def failover(
)

def get_long_running_output(response):
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(None, response)
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down