Last active
January 31, 2018 21:05
-
-
Save exit99/20e32718c0f111cc9e04e62c436c0966 to your computer and use it in GitHub Desktop.
Provisioning by option instead of location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Current logic for reserving a device by location: | |
device = hapi.devices.get(server.device_id).json() | |
device_location = device.get('location') | |
if location == device_location: | |
target = server | |
# The new logic for reserving by option tags, then defaulting to location. | |
if has_sps_location_tag: | |
device = hapi.devices.get(server.device_id).json() | |
tag = device.option.tag | |
device_location = device.get('location') | |
if device_location == tag: | |
target = server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment