Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/unmanage_node.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import requests
from orionsdk import SwisClient
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone


def main():
Expand All @@ -14,7 +14,7 @@ def main():
nodeId = results['results'][0]['NodeID']
caption = results['results'][0]['Caption']
netObjectId = 'N:{}'.format(nodeId)
now = datetime.utcnow()
now = datetime.now(timezone.utc)
tomorrow = now + timedelta(days=1)
swis.invoke('Orion.Nodes', 'Unmanage', netObjectId, now, tomorrow, False)
print('Done...{} will be unmanaged until {}'.format(caption, tomorrow))
Expand Down