Skip to content

Commit

Permalink
Merge pull request #897 from xor-xor/fix_1715
Browse files Browse the repository at this point in the history
Fix for Proxmox3 (family recognizing + listening port).
  • Loading branch information
andrzej-jankowski committed May 28, 2014
2 parents 5cefedd + 3c64c64 commit 661cf28
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/ralph/discovery/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ def get_http_info(ip):
urllib2.URLError, httplib.BadStatusLine, httplib.InvalidURL,
socket.timeout, SSLError, socket.error,
):
return {}, ''
request = urllib2.Request(
"https://{}".format(':'.join((ip, '8006'))) # for Proxmox
)
try:
response = opener.open(request, timeout=5)
except urllib2.HTTPError as e:
response = e
except (
urllib2.URLError, httplib.BadStatusLine, httplib.InvalidURL,
socket.timeout, SSLError, socket.error,
):
return {}, ''

def closer():
try:
Expand Down Expand Up @@ -119,6 +130,8 @@ def guess_family(headers, document):
family = 'Dell'
elif 'Juniper' in document:
family = 'Juniper'
elif family in ('pve-api-daemon',):
family = 'Proxmox'
return family


Expand Down

0 comments on commit 661cf28

Please sign in to comment.