Skip to content

Commit

Permalink
Addressed other rubocop/pr review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
h-kataria committed Oct 2, 2017
1 parent 9d0557b commit cfd4788
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function aeMethodFormController($http, $scope, aeMethodFormId, currentRegion, mi
vm.aeMethodModel.provisioning_machine_credential_id = configData.credential_id;
vm.aeMethodModel.provisioning_network_credential_id = configData.network_credential_id;
vm.aeMethodModel.provisioning_cloud_credential_id = playbookReusableCodeMixin.setIfDefined(configData.cloud_credential_id);
vm.aeMethodModel.provisioning_become_enabled = configData.become_enabled === 'true' ? true : false;
vm.aeMethodModel.provisioning_become_enabled = configData.become_enabled === 'true';
vm.aeMethodModel.provisioning_key = '';
vm.aeMethodModel.provisioning_value = '';

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2342,12 +2342,12 @@ def fetch_name_from_object(klass, id)
def verbosity_display(verbosity)
verbosity ||= "0"
verbosity_hsh = {
"0" => "0 (Normal)",
"1" => "1 (Verbose)",
"2" => "2 (More Verbose)",
"3" => "3 (Debug)",
"4" => "4 (Connection Debug)",
"5" => "5 (WinRM Debug)"
"0" => _("0 (Normal)"),
"1" => _("1 (Verbose)"),
"2" => _("2 (More Verbose)"),
"3" => _("3 (Debug)"),
"4" => _("4 (Connection Debug)"),
"5" => _("5 (WinRM Debug)")
}
verbosity_hsh[verbosity.to_s]
end
Expand Down
11 changes: 9 additions & 2 deletions app/controllers/miq_ae_class_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ def add_update_method
method.language = params["language"]
method.scope = params["scope"]
method.class_id = params[:class_id]
method.data = YAML.dump(set_playbook_data)
method.data = YAML.dump(set_playbook_data)
begin
MiqAeMethod.transaction do
to_save, to_delete = playbook_inputs(method)
Expand Down Expand Up @@ -2688,7 +2688,14 @@ def get_method_node_info(id)

def fetch_playbook_details
@playbook_details = {}
data = YAML.load(@record.data)
whitelist_symbols = [:repository_id,
:playbook_id,
:credential_id,
:network_credential_id,
:cloud_credential_id,
:verbosity,
:become_enabled]
data = YAML.safe_load(@record.data, [Symbol], whitelist_symbols, false, nil)
@playbook_details[:repository] = fetch_name_from_object(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScriptSource, data[:repository_id])
@playbook_details[:playbook] = fetch_name_from_object(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Playbook, data[:playbook_id])
@playbook_details[:machine_credential] = fetch_name_from_object(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::MachineCredential, data[:credential_id])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"checkchange" => true}
%span.help-block{"ng-show" => "angularForm.#{prefix}_inventory.$error.miqrequired"}
= _("Required")
.form-group{"ng-if" =>"#{ng_model}.#{prefix}_execution_ttl!==undefined","ng-class" => "{'has-error': angularForm.#{prefix}_execution_ttl.$invalid}"}
.form-group{"ng-if" =>"#{ng_model}.#{prefix}_execution_ttl!==undefined", "ng-class" => "{'has-error': angularForm.#{prefix}_execution_ttl.$invalid}"}
%label.col-md-3.control-label{"for" => "#{prefix}_execution_ttl"}
= _("Max TTL (mins)")
.col-md-9
Expand Down

0 comments on commit cfd4788

Please sign in to comment.