From 3e40a87efeff633add6a75a0eb3ae6df3fd6c44d Mon Sep 17 00:00:00 2001 From: Philip Guyton Date: Sun, 2 Jul 2017 11:46:02 +0100 Subject: [PATCH 1/3] update 'create pool' dev table to use new format links #1750 --- .../storageadmin/js/templates/pool/add_pool_template.jst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rockstor/storageadmin/static/storageadmin/js/templates/pool/add_pool_template.jst b/src/rockstor/storageadmin/static/storageadmin/js/templates/pool/add_pool_template.jst index 9f440c134..67a817e3f 100644 --- a/src/rockstor/storageadmin/static/storageadmin/js/templates/pool/add_pool_template.jst +++ b/src/rockstor/storageadmin/static/storageadmin/js/templates/pool/add_pool_template.jst @@ -81,11 +81,11 @@ {{mathHelper @index}} {{this.name}} {{#if this.parted}} - + {{/if}} {{#if (isOpenLuks this.role)}} - + {{/if}} From dc21d1334203478eb1d1ce9bbd1c8d086fcc96ce Mon Sep 17 00:00:00 2001 From: Philip Guyton Date: Sun, 2 Jul 2017 13:13:32 +0100 Subject: [PATCH 2/3] update S.MA.R.T custom options - new api url format #1750 --- .../static/storageadmin/js/views/smartcustom_disks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rockstor/storageadmin/static/storageadmin/js/views/smartcustom_disks.js b/src/rockstor/storageadmin/static/storageadmin/js/views/smartcustom_disks.js index b7ae770be..f3f283951 100644 --- a/src/rockstor/storageadmin/static/storageadmin/js/views/smartcustom_disks.js +++ b/src/rockstor/storageadmin/static/storageadmin/js/views/smartcustom_disks.js @@ -269,7 +269,7 @@ SmartcustomDiskView = RockstorLayoutView.extend({ if (buttonDisabled(button)) return false; disableButton(button); var submitmethod = 'POST'; - var posturl = '/api/disks/' + disk_name + '/smartcustom-drive'; + var posturl = '/api/disks/' + disk_id + '/smartcustom-drive'; $.ajax({ url: posturl, type: submitmethod, From 3ae84a1509d17739f8f239dac45f0feda37974aa Mon Sep 17 00:00:00 2001 From: Philip Guyton Date: Sun, 2 Jul 2017 15:15:32 +0100 Subject: [PATCH 3/3] disk id as string in Exception messages #1750 --- src/rockstor/storageadmin/views/disk.py | 12 ++++++------ src/rockstor/storageadmin/views/disk_smart.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rockstor/storageadmin/views/disk.py b/src/rockstor/storageadmin/views/disk.py index 59b0507cd..68e3436b2 100644 --- a/src/rockstor/storageadmin/views/disk.py +++ b/src/rockstor/storageadmin/views/disk.py @@ -388,7 +388,7 @@ def _validate_disk(did, request): try: return Disk.objects.get(id=did) except: - e_msg = ('Disk(%d) does not exist' % did) + e_msg = ('Disk(%s) does not exist' % did) handle_exception(Exception(e_msg), request) @staticmethod @@ -463,11 +463,11 @@ def delete(self, request, did): try: disk = Disk.objects.get(id=did) except: - e_msg = ('Disk: %d does not exist' % did) + e_msg = ('Disk: %s does not exist' % did) handle_exception(Exception(e_msg), request) if (disk.offline is not True): - e_msg = ('Disk: %d is not offline. Cannot delete' % did) + e_msg = ('Disk: %s is not offline. Cannot delete' % did) handle_exception(Exception(e_msg), request) try: @@ -519,10 +519,10 @@ def _wipe(self, did, request): reverse_name, isPartition = self._reverse_role_filter_name(disk_name, request) if reverse_name != disk.name: - e_msg = ('Wipe operation on whole or partition of device (%d) was ' + e_msg = ('Wipe operation on whole or partition of device (%s) was ' 'rejected as there was a discrepancy in device name ' 'resolution. Wipe was called with device name (%s) which ' - 'redirected to (%d) but a check on this redirection ' + 'redirected to (%s) but a check on this redirection ' 'returned device name (%s), which is not equal to the ' 'caller name as was expected. A Disks page Rescan may ' 'help.' @@ -707,7 +707,7 @@ def _btrfs_disk_import(self, did, request): import_snapshots(share) return Response(DiskInfoSerializer(disk).data) except Exception as e: - e_msg = ('Failed to import any pool on this device(%d). Error: %s' + e_msg = ('Failed to import any pool on this device(%s). Error: %s' % (did, e.__str__())) handle_exception(Exception(e_msg), request) diff --git a/src/rockstor/storageadmin/views/disk_smart.py b/src/rockstor/storageadmin/views/disk_smart.py index f1fac2aca..642ccc969 100644 --- a/src/rockstor/storageadmin/views/disk_smart.py +++ b/src/rockstor/storageadmin/views/disk_smart.py @@ -42,7 +42,7 @@ def _validate_disk(did, request): try: return Disk.objects.get(id=did) except: - e_msg = ('Disk: %d does not exist' % did) + e_msg = ('Disk: %s does not exist' % did) handle_exception(Exception(e_msg), request) def get(self, *args, **kwargs):