Skip to content

Commit 2cbf21a

Browse files
Merge pull request #2 from device42/D42-14332
D42-14332 - Foreman integration with Red Hat Satellite 6.6 which has foreman 1.22 Fixes issues getting data from Foreman.
2 parents c4d8f4d + 60e6641 commit 2cbf21a

9 files changed

+90
-994
lines changed

device42.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ def _send(self, method, path, data=None):
4141
if method == 'GET':
4242
params = data
4343
data = None
44+
4445
resp = requests.request(method, url, data=data, params=params,
4546
auth=(self.user, self.pwd),
4647
verify=self.verify_cert, headers=self.headers)
4748
if not resp.ok:
4849
raise Device42HTTPError("HTTP %s (%s) Error %s: %s request was %s" %
4950
(method, path, resp.status_code, resp.text, data))
5051
retval = resp.json()
51-
# print(retval)
5252
return retval
5353

5454
def _get(self, path, data=None):
@@ -74,10 +74,11 @@ def _log(self, message, level="DEBUG"):
7474
def update_device(self, **kwargs):
7575
""" See http://api.device42.com/#create/update-device-by-name """
7676
path = 'devices'
77-
atleast_fields = "name serial_no uuid".split()
77+
atleast_fields = ["name"] # this is the only required field to create/update a device, serial and uuid opt
7878
known_fields = "new_name asset_no manufacturer hardware new_hardware is_it_switch"
7979
known_fields += " is_it_virtual_host is_it_blade_host in_service type service_level virtual_host"
80-
known_fields += " blade_host slot_no storage_room_id storage_room os osver memory cpucount cpupower cpucore"
80+
known_fields += " serial_no uuid"
81+
known_fields += " blade_host slot_no storage_room_id storage_room os osver osverno memory cpucount cpupower cpucore"
8182
known_fields += " hddcount hddsize hddraid hddraid_type macaddress devices_in_cluster appcomps"
8283
known_fields += " customer contract_id contract"
8384
known_fields += " aliases subtype virtual_subtype notes tags"

examples/puppet38_nodeinfo_ubuntu.json

-234
This file was deleted.

0 commit comments

Comments
 (0)