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

Adds ability to supply template files to catalog request #57

Merged
merged 3 commits into from
Sep 19, 2017

Conversation

logicminds
Copy link
Contributor

@logicminds logicminds commented Sep 7, 2017

Description

Adds ability to supply custom request templates from file. If you have a bunch of
saved catalog templates you can now just create catalog requests from those templates
or even just merge in those templates with your current catalog request object.

Why is this important? Test-kitchen automates this process for you. But if you are not using this for some other project, you will eventually want to have this feature since trying to merge properties via set_parameter is very painful. As noted in #54

This MR also supersedes #56 since it was required to make this feature. Merging this request negates the need to merge #56

This MR also fixes some tests that were skipped in the catalog_request specs.

For an example catalog template, please see spec/fixtures/catalog_request_template.json

Issues Resolved

N|A

Check List

  • All tests pass.
  • All style checks pass.
  • Functionality includes testing.
  • Functionality has been documented in the README if applicable

  * dump a single template or all templates using class methods
  * moves test from request to client_spec where it should be
  * previously if you wanted to create a request from a old request
    you had to carefully merge the values from a json payload into
    parameters.  This makes it dead simple by allowing the user
    to create a request from a previously saved request template
    file.
@logicminds
Copy link
Contributor Author

Travis isn't responding correctly despite passing tests.

@logicminds
Copy link
Contributor Author

@jjasghar have you had a chance to look at this?

@jjasghar
Copy link

I just got my vRA instance up last week. I'll be revisiting this ASAP.

@logicminds
Copy link
Contributor Author

For reference real world usage is documented here: https://github.com/nwops/kitchen-vmpool#vmware-vra-pool-creation-scripts

Scripts
https://github.com/nwops/kitchen-vmpool/tree/master/exe

Although the code is very specific to my use case and contains a few monkey patches.

@okleinschmidt
Copy link

Hi all,
I've tested @logicminds changes successful in our PoC environment against vRA 7.3. Great work, hope it will be merged soon. :-)

@jjasghar
Copy link

@okleinschmidt can you verify the destroy method works with 7.3? I think I found a bug with it, downstream with chef/knife-vrealize#33 but it resonates in this gem.

As you can see from the second comment they moved the operations api out of ResourceData. :(

@okleinschmidt
Copy link

@jjasghar for me destroy works as well. I've verified with my own code which uses vmware-vra gem as well as with knife-vrealize (see below). The chef server error happens because there is no chef at the moment.

`knife vra server delete aaad0736-ad95-4aa9-a1ac-55722cf091d6
Server ID: aaad0736-ad95-4aa9-a1ac-55722cf091d6
Server Name: XXXX
Waiting For vRA to collect the IPWaiting For vRA to collect the IPIP Addresses: fe80::86de:6ec6:a8a8:77ae
Status: ACTIVE
Owner IDs: XXXX
Owner Names: Ole Kleinschmidt

Do you really want to delete this server? (Y/N) y
Destroy request 4d29a977-dd2b-4a09-8ab6-05325c7ccc30 submitted.
Waiting for request to complete.
Current request status: PENDING_PRE_APPROVAL.
Current request status: IN_PROGRESS..............................
Current request status: PENDING_POST_APPROVAL.
Destroy request complete.

Request Status: SUCCESSFUL
Completion State: SUCCESSFUL

WARNING: Corresponding node and client for the XXXX server were not deleted and remain registered with the Chef Server
`

@jjasghar
Copy link

Oh wow, it must be my environment then. Thanks! I'll work on it asap, and then get this merged and released.

@jjasghar jjasghar merged commit a05dc51 into test-kitchen:master Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants