From 18783895d5a46767c0a907dd2b39c3bef07d9c46 Mon Sep 17 00:00:00 2001 From: Madhuri Date: Fri, 20 Nov 2015 07:14:42 -0800 Subject: [PATCH] remove dead code from appliance.py. #1014 --- src/rockstor/storageadmin/views/appliances.py | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/rockstor/storageadmin/views/appliances.py b/src/rockstor/storageadmin/views/appliances.py index 8a2684501..a71b51978 100644 --- a/src/rockstor/storageadmin/views/appliances.py +++ b/src/rockstor/storageadmin/views/appliances.py @@ -75,38 +75,7 @@ def _get_remote_appliance(self, request, ip, port, client_id, 'all inputs and try again.') handle_exception(Exception(e_msg), request) - def _connect_to_appliance(self, request, url, ip, username, password): - try: - r = requests.post( - url, - headers={'content-type': 'application/json'}, - verify=False, - data=json.dumps({'username': username, - 'password': password}), - timeout=30.0) - if (r.status_code == 401): - #login incorrect - logger.error(r.text) - e_msg = ('Authentication to the remote Rockstor ' - 'appliance(%s) failed due to wrong id or ' - 'secret. Try again.' % ip) - handle_exception(Exception(e_msg), request) - if (r.status_code != 200): - logger.error(r.text) - e_msg = ('Could not establish connection with the remote ' - 'Rockstor appliance(%s)') - handle_exception(e_msg, request) - except requests.exceptions.ConnectionError, e: - logger.exception(e) - e_msg = ('Could not reach the remote Rockstor appliance(%s). ' - 'Verify the IP or hostname provided and try again' % ip) - handle_exception(Exception(e_msg), request) - except requests.exceptions.Timeout, e: - logger.exception(e) - e_msg = ('Timeout occured while connecting to the remote ' - 'Rockstor appliance(%s). Try again later.' % ip) - handle_exception(Exception(e_msg), request) - + @transaction.atomic def post(self, request, *args, **kwargs): with self._handle_exception(request):