Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra_var to have metadata #14697

Merged
merged 1 commit into from
Apr 25, 2017
Merged

Conversation

bzwei
Copy link
Contributor

@bzwei bzwei commented Apr 7, 2017

Before extra_vars are hash key-default_value pairs. Now the hash value is another hash used to be store metadata. The first metadata is default value

For example this is the format for :config_info before

      :config_info => {
        :provision  => {
          :extra_vars => {
            'key1' => 'val1',
            'key2' => 'val2'
          }
        }
      }

and this is the new format

      :config_info => {
        :provision  => {
          :extra_vars => {
            'key1' => {:default => 'val1'},
            'key2' => {:default => 'val2'}
          }
        }
      }

In the future we can add more metadata, for example

      :config_info => {
        :provision  => {
          :extra_vars => {
            'key1'      => {:type => 'Integer', :default => 1},
            'secrect' => {:password => true}
          }
        }
      }

@bzwei
Copy link
Contributor Author

bzwei commented Apr 7, 2017

@miq-bot add_label enhancement, providers/ansible_tower, services, fine/yes
@miq-bot assign @gmcculloug

cc @h-kataria UI will need an update to use the new format to pass in the extra_vars to backend.

@miq-bot
Copy link
Member

miq-bot commented Apr 20, 2017

This pull request is not mergeable. Please rebase and repush.

Before extra_vars are hash key-default_value pairs. Now the hash value is another hash used to be store metadata. The first metadata is default value
@miq-bot
Copy link
Member

miq-bot commented Apr 24, 2017

Checked commit bzwei@e57b5ef with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 0 offenses detected
Everything looks good. 🍰

h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Apr 24, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Apr 24, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Apr 24, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Apr 24, 2017
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Apr 24, 2017
- UI changes to support extra vars format in ManageIQ/manageiq#14697
- fixed broken spec test
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Apr 24, 2017
- UI changes to support extra vars format in ManageIQ/manageiq#14697
- fixed broken spec test
@gmcculloug gmcculloug merged commit b84a4eb into ManageIQ:master Apr 25, 2017
@gmcculloug gmcculloug added this to the Sprint 59 Ending Apr 24, 2017 milestone Apr 25, 2017
simaishi pushed a commit that referenced this pull request Apr 25, 2017
extra_var to have metadata
(cherry picked from commit b84a4eb)
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit 4f359963b172afad0144aaef8121236bbec07824
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Tue Apr 25 09:45:06 2017 -0400

    Merge pull request #14697 from bzwei/extra_var_format
    
    extra_var to have metadata
    (cherry picked from commit b84a4ebee79cc9b250630c8aa11eab0ff200f648)

@@ -75,6 +75,9 @@ def get_job_options(action)

def save_job_options(action, overrides)
job_options = options.fetch_path(:config_info, action.downcase.to_sym).slice(:hosts, :extra_vars).with_indifferent_access
job_options[:extra_vars].try(:transform_values!) do |val|
val.kind_of?(String) ? val : val[:default] # TODO: support Hash only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this belong in a migration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Since beta release every new service is having the new format. We don't need provide a migration for pre-beta versions.

@bzwei bzwei deleted the extra_var_format branch April 26, 2017 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants