Merge pull request #42254 from StackPointCloud/profitbricks_fixes

Minor error message improvement and documentation fix
This commit is contained in:
Mike Place 2017-07-25 15:28:21 -05:00 committed by GitHub
commit 7bc8b0eb85
2 changed files with 12 additions and 5 deletions

View File

@ -34,8 +34,8 @@ Configuration
#
username: user@domain.com
password: 123456
# datacenter is the UUID of a pre-existing virtual data center.
datacenter: 9e6709a0-6bf9-4bd6-8692-60349c70ce0e
# datacenter_id is the UUID of a pre-existing virtual data center.
datacenter_id: 9e6709a0-6bf9-4bd6-8692-60349c70ce0e
# Connect to public LAN ID 1.
public_lan: 1
ssh_public_key: /path/to/id_rsa.pub

View File

@ -6,7 +6,7 @@ ProfitBricks Cloud Module
The ProfitBricks SaltStack cloud module allows a ProfitBricks server to
be automatically deployed and bootstraped with Salt.
:depends: profitbrick >= 3.0.0
:depends: profitbrick >= 3.1.0
The module requires ProfitBricks credentials to be supplied along with
an existing virtual datacenter UUID where the server resources will
@ -115,7 +115,8 @@ try:
from profitbricks.client import (
ProfitBricksService, Server,
NIC, Volume, FirewallRule,
Datacenter, LoadBalancer, LAN
Datacenter, LoadBalancer, LAN,
PBNotFoundError
)
HAS_PROFITBRICKS = True
except ImportError:
@ -480,7 +481,13 @@ def list_nodes(conn=None, call=None):
ret = {}
datacenter_id = get_datacenter_id()
nodes = conn.list_servers(datacenter_id=datacenter_id)
try:
nodes = conn.list_servers(datacenter_id=datacenter_id)
except PBNotFoundError:
log.error('Failed to get nodes list from datacenter: {0}'.format(
datacenter_id))
raise
for item in nodes['items']:
node = {'id': item['id']}