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

Draft PR - Issue 352 - Converting booleans to swich #473

Merged
merged 28 commits into from
Oct 21, 2019
Merged

Conversation

mwpreston
Copy link
Contributor

@mwpreston mwpreston commented Oct 18, 2019

Description

Migrated boolean parameters to switch parameters in order to provide a more consistent approach across all cmdlets.

Note: This has the possibility of providing breaking changes as the syntax of calling the parameters like '-Parameter $true' will no longer be supported.

For Example:
Export-RubrikVM -PowerOn $False will continue to run, however the $False gets assigned to the VM Name.

Get-RubrikOrganization -isGlobal $true will now fail.

Will need to ensure these are addressed in the release notes.

Cmdlets affected are Export-RubrikVM, Get-RubrikEvent, Get-RubrikOrganization, New-RubrikHost, New-RubrikMount, Set-RubrikMount, Set-RubrikNutanixVM, Set-RubrikSupportTunnel and Set-RubrikVM

Related Issue

This project only accepts pull requests related to open issues.

  • If suggesting a new feature or change, please discuss it in an issue first.
  • If fixing a bug, there should be an issue describing it with steps to reproduce

Issue 352

Motivation and Context

This provides a consistent approach for our end-users across all of the cmdlets.

How Has This Been Tested?

  • Please describe in detail how you tested your changes.
  • Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc.

Tested within the TM lab on version 4.2 and 5.0

Screenshots (if appropriate):

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTION document.
  • I have updated the CHANGELOG file accordingly for the version that this merge modifies.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mwpreston mwpreston requested a review from jaapbrasser October 18, 2019 17:22
@mwpreston
Copy link
Contributor Author

@jaapbrasser - you might want to have a close look at this one as it does introduce the ability to break existing scripts. For the most part I think the cmdlets are ok - however Export-RubrikVM has changed quite a bit

Export-RubrikVM
Scripts that once passed a true/false to either DisableNetwork, RemoveNetworkDevices, KeepMacAddresses, UnregisterVM, PowerOn, RecoverTags will still run, however, the value of $true/$false will be assigned to vmName - therefore the name of the exported VM is True or False. I feel like this might be a possible issue

These need to be modified to say like Export-RubrikVM -id '111-222' -PowerOn:$false or -PowerOn:$true or simply -PowerOn
Even then, some API attributes have defaults - so even if you leave out the -PowerOn, the VM will be poweredOn.

We may want to proceed with this PR and possibly just exclude the changes on the Export-VM cmdlet ??

@mwpreston mwpreston changed the base branch from master to devel October 18, 2019 18:53
@mwpreston mwpreston changed the base branch from devel to master October 18, 2019 18:54
@jaapbrasser jaapbrasser marked this pull request as ready for review October 21, 2019 12:25
jaapbrasser
jaapbrasser previously approved these changes Oct 21, 2019
Copy link
Contributor

@jaapbrasser jaapbrasser left a comment

Choose a reason for hiding this comment

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

Reviewed and tested your changes, thanks for you contribution @mwpreston! :shipit:

Copy link
Contributor

@jaapbrasser jaapbrasser left a comment

Choose a reason for hiding this comment

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

Fixed psd1 :shipit:

@jaapbrasser jaapbrasser merged commit de4fce1 into master Oct 21, 2019
@jaapbrasser jaapbrasser deleted the mwpreston-352 branch October 21, 2019 12:29
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.

2 participants