Index: /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/log_location.py
===================================================================
--- /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/log_location.py	(revision 2386)
+++ /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/log_location.py	(working copy)
@@ -22,6 +22,10 @@
             storage_type = request.GET.get('type')
             if str(storage_type).strip() == 'secondary':
                 response_data = log_service.get_secondary_drive_info()
+                if not response_data['is_disk_available']:
+                    response_data = {'is_disk_available': False,
+                                     'message': 'There is no secondary disk attached to the system.'
+                                                'Please contact Administrator to add additional disk space'}
             else:
                 return HttpResponse(json.dumps({
                     'error': 500,
@@ -62,9 +66,15 @@
 
 def change_log_location(request):
     try:
-        if request.method == 'POST' or request.method == 'PUT':
+        if request.method == 'POST':
             req_json = json.loads(request.body)
-            response_data = log_service.change_log_location(req_json)
+            if 'location' in req_json:
+                log_location = req_json['location']
+            else:
+                oper_log('error', 'system', 'Log Location not specified')
+                raise ge.GenericError(400, "Log Location not specified")
+
+            response_data = log_service.change_log_location(log_location)
             return HttpResponse(json.dumps(response_data), content_type='application/json')
         else:
             return HttpResponse(json.dumps({
@@ -84,7 +94,8 @@
     except ge.GenericError as e:
         # Log the error (optional)
         oper_log('error', 'system', 'Error while creating partition: {}'.format(e))
-        e.message = "Error while creating partition"
+        if (e.message is None):
+            e.message = "Error while creating partition"
         return ge.handle_exception(e)
     except Exception as e:
         # Handle unexpected exceptions
Index: /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/services/log_location_service.py
===================================================================
--- /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/services/log_location_service.py	(revision 2386)
+++ /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/services/log_location_service.py	(working copy)
@@ -24,7 +24,7 @@
         secondary_drive_info = {}
         for line in lines[1:]:  # Skip the header line
             parts = line.split()
-            if 'secondary' in parts[-1]:
+            if const.SECONDARY in parts[-1]:
                 total_space = convert_to_bytes(parts[1])
                 used_space = convert_to_bytes(parts[2])
                 available_space = convert_to_bytes(parts[3])
@@ -105,8 +105,7 @@
 
         # Display unmounted disks
         if len(unmounted_disk_dict) == 0 and len(unmounted_disks) == 0:
-            raise ge.GenericError(500, "There is no secondary disk attached to the system. "
-                                       "Please contact Administrator to add additional disk space")
+            return None
 
         disk_info = unmounted_disks[0], unmounted_disk_dict[unmounted_disks[0]]
         return disk_info
@@ -141,34 +140,33 @@
         raise ge.GenericError(500, "Log location is not specified")
 
 
-def change_log_location(req_json):
+def change_log_location(log_location):
     """ Changes the log location from For Eg from 'primary' to 'secondary' or vice versa """
 
     try:
-        if 'location' in req_json:
-            log_location = req_json['location']
-        else:
-            oper_log('error', 'system', 'Log Location not specified')
-            raise ge.GenericError(400, "Log Location not specified")
-
-        if log_location == 'secondary':
-            log_location = SECONDARY_LOG_LOCATION
+        if log_location == const.SECONDARY:
+            log_location = const.SECONDARY_LOG_LOCATION
             secondary_drive_info = get_secondary_drive_info()
 
             if secondary_drive_info.get('is_disk_available'):
                 if not secondary_drive_info.get('is_mounted'):
                     create_partition(secondary_drive_info)
                 create_elastic_search_dir()
+            else:
+                return {'is_disk_available': False,
+                        'message': 'There is no secondary disk attached to the system.'
+                                   'Please contact Administrator to add additional disk space'}
 
-        elif log_location == 'primary':
-            log_location = '/var/log/elasticsearch'
+        elif log_location == const.PRIMARY:
+            log_location = const.PRIMARY_LOG_LOCATION
         else:
             oper_log('error', 'system', 'Invalid location specified: {}'.format(log_location))
             raise ge.GenericError(400, "Invalid location specified: {}. "
-                                       "Valid values are {} and {}".format(log_location, 'primary', 'secondary'))
+                                       "Valid values are {} and {}".format(log_location, const.PRIMARY,
+                                                                           const.SECONDARY))
 
         # Read existing configuration
-        with open(ELASTIC_SEARCH_CONFIG_FILE, 'r') as configfile:
+        with open(const.ELASTIC_SEARCH_CONFIG_FILE, 'r') as configfile:
             lines = configfile.readlines()
 
         updated_lines = []
@@ -180,7 +178,7 @@
 
         # write the updated configuration back to the file
         try:
-            with open(ELASTIC_SEARCH_CONFIG_FILE, 'w') as configfile:
+            with open(const.ELASTIC_SEARCH_CONFIG_FILE, 'w') as configfile:
                 configfile.writelines(updated_lines)
         except IOError as e:
             oper_log('error', 'system', 'Failed to write to config file')
Index: /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/util/__init__.py
===================================================================
--- /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/util/__init__.py	(revision 0)
+++ /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/util/__init__.py	(working copy)
@@ -0,0 +1 @@
+__all__ = ['constants']
\ No newline at end of file
Index: /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/util/constants.py
===================================================================
--- /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/util/constants.py	(revision 0)
+++ /branches/amp_3_7_0/src/webui/webui/htdocs/new/src/hive/util/constants.py	(working copy)
@@ -0,0 +1,9 @@
+SECONDARY = 'secondary'
+
+PRIMARY = 'primary'
+
+PRIMARY_LOG_LOCATION = '/var/log/elasticsearch'
+
+SECONDARY_LOG_LOCATION = '/secondary/elasticsearch'
+
+ELASTIC_SEARCH_CONFIG_FILE = '/etc/elasticsearch/elasticsearch.yml'
\ No newline at end of file
