Skip to content

Commit

Permalink
Merge pull request #42254 from StackPointCloud/profitbricks_fixes
Browse files Browse the repository at this point in the history
Minor error message improvement and documentation fix
  • Loading branch information
Mike Place authored Jul 25, 2017
2 parents 1bae9b7 + cb03011 commit 7bc8b0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/topics/cloud/profitbricks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Configuration
#
username: [email protected]
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
Expand Down
13 changes: 10 additions & 3 deletions salt/cloud/clouds/profitbricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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
Expand Down Expand Up @@ -115,7 +115,8 @@
from profitbricks.client import (
ProfitBricksService, Server,
NIC, Volume, FirewallRule,
Datacenter, LoadBalancer, LAN
Datacenter, LoadBalancer, LAN,
PBNotFoundError
)
HAS_PROFITBRICKS = True
except ImportError:
Expand Down Expand Up @@ -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']}
Expand Down

0 comments on commit 7bc8b0e

Please sign in to comment.