Skip to content

Commit

Permalink
Add additional logging to Linode salt-cloud driver (#35895)
Browse files Browse the repository at this point in the history
* Add additional logging to Linode salt-cloud driver

Now displays the following when a profile can't be resolved:

```
Usage: salt-cloud

salt-cloud: error: There was a profile error: The DistributionID for the 'Ubuntu 16.04' profile could not be found.
The 'zjenkins-ubuntu16-a302b4' instance could not be provisioned. The following distributions are available:
['Arch 2016.06.01',
 'CentOS 7',
 'Debian 7',
 'Debian 8',
 'Fedora 24',
 'Gentoo 2014.12',
 'openSUSE Leap 42.1',
 'Slackware 14.1',
 'Ubuntu 14.04 LTS',
 'Ubuntu 16.04 LTS',
 'CentOS 5.6',
 'CentOS 6.5',
 'Fedora 23',
 'Gentoo 2013-11-26',
 'openSUSE 13.1',
 'openSUSE 13.2',
 'Slackware 13.37',
 'Ubuntu 12.04 LTS',
 'Slackware 13.37 32bit']
```

* Sort list
  • Loading branch information
Mike Place authored and Nicole Thomas committed Aug 30, 2016
1 parent a756c4b commit 135c403
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions salt/cloud/clouds/linode.py
Expand Up @@ -868,9 +868,11 @@ def get_distribution_id(vm_):
if not distro_id:
raise SaltCloudNotFound(
'The DistributionID for the \'{0}\' profile could not be found.\n'
'The \'{1}\' instance could not be provisioned.'.format(
'The \'{1}\' instance could not be provisioned. The following distributions '
'are available:\n{2}'.format(
vm_image_name,
vm_['name']
vm_['name'],
pprint.pprint(sorted([distro['LABEL'].encode(__salt_system_encoding__) for distro in distributions]))
)
)

Expand Down

0 comments on commit 135c403

Please sign in to comment.