Skip to content

Commit

Permalink
get_connection: Error on invalid deployment_type
Browse files Browse the repository at this point in the history
Without this, you get "UnboundLocalError: local variable 'conn'
referenced before assignment"

Signed-off-by: Zack Cerza <[email protected]>
  • Loading branch information
zmc committed Jan 31, 2020
1 parent f54afc5 commit cc9877f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ceph_medic/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def get_connection(hostname, username=None, threads=5, use_sudo=None, detect_sud
threads=threads,
detect_sudo=detect_sudo,
)
else:
raise RuntimeError(
'Invalid deployment_type: %s' % deployment_type)
# Set a timeout value in seconds to disconnect and move on
# if no data is sent back.
conn.global_timeout = 300
Expand Down

0 comments on commit cc9877f

Please sign in to comment.