-
Notifications
You must be signed in to change notification settings - Fork 74
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
Export Import of Expression Methods #50
Conversation
describe MiqAeExpressionMethod do | ||
include Spec::Support::AutomationHelper | ||
let(:user) { FactoryGirl.create(:user_with_group) } | ||
let(:vm1) { FactoryGirl.create(:vm, :name => 'test_2.1', :cpu_shares => 400) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkanoor Could you use the let! for vm1-vm3 here so you don't have to reference them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkanoor Looks good.
44ab28d
to
6012299
Compare
app/models/miq_ae_yaml_export.rb
Outdated
@@ -201,6 +201,8 @@ def get_method_filename(method_obj) | |||
"#{method_obj.name}#{FILE_EXTENSIONS[method_obj.language]}" | |||
elsif method_obj['location'] == 'uri' | |||
"#{method_obj.name}.uri" | |||
elsif method_obj['location'] == 'expression' | |||
"#{method_obj.name}.expr" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the expression data being saved in YAML
format? If so do we need a new file type or can we just use .yaml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug We use the YAML extension to store method properties file, and we fetch all the methods based on the extension.
d450173
to
2c10f5e
Compare
The expressions are stored in the data section of yaml
72ecf90
to
b557ecf
Compare
Checked commits mkanoor/manageiq-automation_engine@0a520fc~...b557ecf with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 spec/models/miq_ae_yaml_import_export_spec.rb
|
The yaml file looks like ---
object_type: method
version: 1.0
object:
attributes:
name: ExpTest
display_name:
description:
scope: instance
language: ruby
location: expression
data: |
---
:db: AvailabilityZone
:expression:
"=":
field: AvailabilityZone-href_slug
value: :user_input
inputs:
- field:
aetype:
name: arg1
display_name:
datatype:
priority: 1
owner:
default_value: "${/#prefix}"
substitute: false
message: create
visibility:
collect:
scope:
description:
condition:
on_entry:
on_exit:
on_error:
max_retries:
max_time: |
Closed in favor of #56 |
This PR allows expressions to be exported and imported. The expression files are stored with the extension .expr in the export/import deck
https://www.pivotaltracker.com/n/projects/1613499/stories/148625717