Skip to content

Commit

Permalink
Merge pull request #1751 from phillxnet/1750_minor_disk_api_regressio…
Browse files Browse the repository at this point in the history
…n_follow_up

minor disk api regression follow up. Fixes #1750
  • Loading branch information
schakrava authored Jul 2, 2017
2 parents 15b26b9 + 3ae84a1 commit 0bc9216
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@
<td>{{mathHelper @index}}</td>
<td>{{this.name}}
{{#if this.parted}}
<a href="#disks/role/{{this.name}}" class="user_role_part" data-disk-name="{{this.name}}" title="Partition (Redirect Role), click to edit. Capacity is for whole disk." rel="tooltip">
<a href="#disks/role/{{this.id}}" class="user_role_part" data-disk-id="{{this.id}}" title="Partition (Redirect Role), click to edit. Capacity is for whole disk." rel="tooltip">
<i class="glyphicon glyphicon-tags"></i></a>
{{/if}}
{{#if (isOpenLuks this.role)}}
<a href="#disks/luks/{{this.name}}" class="open_luks_drive" data-disk-name="{{this.name}}" title="Open LUKS Volume, click to review." rel="tooltip">
<a href="#disks/luks/{{this.id}}" class="open_luks_drive" data-disk-id="{{this.id}}" title="Open LUKS Volume, click to review." rel="tooltip">
<i class="glyphicon glyphicon-eye-open"></i></a>
{{/if}}
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/rockstor/storageadmin/views/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.'
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/rockstor/storageadmin/views/disk_smart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0bc9216

Please sign in to comment.