Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Showing list of available policies in case of wrong policy name #1022

Merged
merged 1 commit into from
Mar 11, 2017

Conversation

pshahzeb
Copy link
Contributor

@pshahzeb pshahzeb commented Mar 11, 2017

If the policy name while creating a volume is wrong, and if valid policies exist, show their names as available options along with the error message

[root@sc-rdops-vm17-dhcp-12-47:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py policy ls
Policy Name  Policy Content                                              Active
-----------  ----------------------------------------------------------  ------
poltest4     (("proportionalCapacity" i0)("hostFailuresToTolerate" i0))  Unused
poltest      (("proportionalCapacity" i0)("hostFailuresToTolerate" i0))  Unused
poltest2     (("proportionalCapacity" i0)("hostFailuresToTolerate" i0))  Unused
root@photon-xVmYMbyTn [ ~ ]# docker volume create --driver=vsphere --name test_vol -o size=100MB -o vsan-policy-name=i_dont_exist
Error response from daemon: create test_vol: VolumeDriver.Create: Policy i_dont_exist does not exist. Available policies are: ['poltest2', 'poltest', 'poltest4']

Fixes #421

Copy link
Contributor

@msterin msterin left a comment

Choose a reason for hiding this comment

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

Pending CI pass (known issue failure is OK)

@msterin
Copy link
Contributor

msterin commented Mar 11, 2017

I love the message Policy i_dont_exist does not exist 👍

Copy link
Contributor

@shuklanirdesh82 shuklanirdesh82 left a comment

Choose a reason for hiding this comment

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

LGTM!

@msterin msterin merged commit a5eea82 into master Mar 11, 2017
@msterin msterin deleted the issue_421.pshahzeb branch March 11, 2017 02:05
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants