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

Return list of allowed datastores if datastore does not exist in volume create command #817

Closed
shuklanirdesh82 opened this issue Dec 13, 2016 · 0 comments

Comments

@shuklanirdesh82
Copy link
Contributor

Steps to reproduce:

  1. execute following volume creation command where 'abc' is not a valid datastore name in the inventory
# docker volume create --driver=vmdk --name=MyVol22334@abc -o size=1gb
Error response from daemon: create MyVol22334@abc: VolumeDriver.Create: Server returned an error: TypeError('can only join an iterable',)

Expectation: proper error message should be return to let user know that supplied datastore is not exist

on ESX (vmdk_ops.log):

12/13/16 21:02:37 2663252 [Thread-102] [ERROR  ] Unhandled Exception:
Traceback (most recent call last):
  File "/usr/lib/vmware/vmdkops/bin/vmdk_ops.py", line 1310, in execRequestThread
    opts=opts)
  File "/usr/lib/vmware/vmdkops/bin/vmdk_ops.py", line 693, in executeRequest
    % (datastore, ", ".join(get_datastore_names_list), vm_datastore))
TypeError: can only join an iterable
12/13/16 21:02:37 2663252 [Thread-103] [ERROR  ] Unhandled Exception:
Traceback (most recent call last):
  File "/usr/lib/vmware/vmdkops/bin/vmdk_ops.py", line 1310, in execRequestThread
    opts=opts)
  File "/usr/lib/vmware/vmdkops/bin/vmdk_ops.py", line 693, in executeRequest
    % (datastore, ", ".join(get_datastore_names_list), vm_datastore))
TypeError: can only join an iterable
@pdhamdhere pdhamdhere added this to the v1 GA milestone Feb 1, 2017
@pdhamdhere pdhamdhere changed the title Meaningful error should be returned while using full volume name for volume creation and datastore is not exist with that name Return list of allowed datastores if datastore does not exist in volume create command Feb 15, 2017
@pdhamdhere pdhamdhere added P0 and removed P1 labels Feb 15, 2017
@pdhamdhere pdhamdhere modified the milestones: 0.12, v1 GA Feb 16, 2017
@pdhamdhere pdhamdhere assigned govint and unassigned lipingxue Feb 16, 2017
pdhamdhere added a commit that referenced this issue Feb 17, 2017
Fixes #817

Without this change:
```
root@Photon-1 [ ~ ]# docker volume create -d vmdk --name=v1@bad
Error response from daemon: create v1@bad: VolumeDriver.Create: Server returned an error: TypeError('can only join an iterable',)
```

After this change:
```
root@Photon-1 [ ~ ]# docker volume create -d vmdk --name=v1@bad
Error response from daemon: create v1@bad: VolumeDriver.Create: Invalid datastore 'bad'.
Known datastores: datastore1, datastore2.
Default datastore: datastore1
```
pdhamdhere added a commit that referenced this issue Feb 17, 2017
Fixes #817

Without this change:
```
root@Photon-1 [ ~ ]# docker volume create -d vmdk --name=v1@bad
Error response from daemon: create v1@bad: VolumeDriver.Create: Server returned an error: TypeError('can only join an iterable',)
```

After this change:
```
root@Photon-1 [ ~ ]# docker volume create -d vmdk --name=v1@bad
Error response from daemon: create v1@bad: VolumeDriver.Create: Invalid datastore 'bad'.
Known datastores: datastore1, datastore2.
Default datastore: datastore1
```
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants