Index: /branches/amp_3_7/extensions/license_server/webui/model/cm_device/__init__.py
===================================================================
--- /branches/amp_3_7/extensions/license_server/webui/model/cm_device/__init__.py	(revision 2655)
+++ /branches/amp_3_7/extensions/license_server/webui/model/cm_device/__init__.py	(working copy)
@@ -285,6 +285,16 @@
                     if rest_body['code'] == 0:
                         data['version'] = rest_body['data']['version']
                         data['connection'] = 'connected'
+                        # ToDo: Fix it with dynamic device type.
+                        wr_mem_resp_data = send_https_rest_request('POST', '/rest/apv/cli_extend',
+                                                                   json.dumps({"cmd": "write memory"}),
+                                                                   data['ip'],
+                                                                   data['restapi_port'],
+                                                                   data['restapi_username'],
+                                                                   data['restapi_password'],
+                                                                   lock=False)
+                        if wr_mem_resp_data['status'] != 200:
+                            raise ModelQueryException(CLICmdError('Failed to save the configuration! Please make sure to save the config on the device!'))
                     else:
                         raise ModelQueryException(CLICmdError(rest_body['msg']))
                 elif rest_response_data['status'] == 401:
@@ -398,6 +408,17 @@
                         if rest_body['code'] == 0:
                             each['version'] = rest_body['data']['version']
                             each['connection'] = 'connected'
+                            # ToDo: Fix it with dynamic device type.
+                            wr_mem_resp_data = send_https_rest_request('POST', '/rest/apv/cli_extend',
+                                                                       json.dumps({"cmd": "write memory"}),
+                                                                       each['ip'],
+                                                                       each['restapi_port'],
+                                                                       each['restapi_username'],
+                                                                       each['restapi_password'],
+                                                                       lock=False)
+                            if wr_mem_resp_data['status'] != 200:
+                                raise ModelQueryException(CLICmdError(
+                                    'Failed to save the configuration! Please make sure to save the config on the device!'))
                     else:
                         msg.append('device "%s" response error.' % rest_response_data['body'])
                 save_sql = "INSERT INTO device2(\
