Skip to content

Commit

Permalink
cinder/manila: reduce creation of global variables
Browse files Browse the repository at this point in the history
This is marked as "blocker code smell" by sonarcloud.io, however
we can fix this easily.
  • Loading branch information
dirkmueller committed Oct 21, 2019
1 parent 15b24be commit 0cf572b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $(document).ready(function($) {
{
//FIXME: right now, there's no good way to localize strings in js :/
if (confirm("All volumes in the backend will be made unavailable; do you really want to delete this backend?")) {
volume_entry = $(this).data("volumeid");
var volume_entry = $(this).data("volumeid");

// delete the backend entry from the attributes JSON
$('#proposal_attributes').removeJsonAttribute('volumes/' + volume_entry);
Expand Down Expand Up @@ -66,8 +66,7 @@ $(document).ready(function($) {
$('#backend_entries').html()
);
}
volumes = $('#proposal_attributes').readJsonAttribute('volumes', {});
volume_defaults = $('#proposal_attributes').readJsonAttribute('volume_defaults', {});
var volumes = $('#proposal_attributes').readJsonAttribute('volumes', {});

// Render forms for backend list
$('#cinder_backends').replaceWith(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $(document).ready(function($) {
{
//FIXME: right now, there's no good way to localize strings in js :/
if (confirm("All shares in the backend will be made unavailable; do you really want to delete this backend?")) {
share_entry = $(this).data("shareid");
var share_entry = $(this).data("shareid");

// delete the backend entry from the attributes JSON
$('#proposal_attributes').removeJsonAttribute('shares/' + share_entry);
Expand Down Expand Up @@ -64,8 +64,7 @@ $(document).ready(function($) {
$('#backend_entries').html()
);
}
shares = $('#proposal_attributes').readJsonAttribute('shares', {});
share_defaults = $('#proposal_attributes').readJsonAttribute('share_defaults', {});
var shares = $('#proposal_attributes').readJsonAttribute('shares', {});

// Render forms for backend list
$('#manila_backends').replaceWith(
Expand Down

0 comments on commit 0cf572b

Please sign in to comment.