mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Allow input from both yaml and json.
This commit is contained in:
@@ -48,7 +48,10 @@ if ops.inout:
|
||||
g_data={}
|
||||
|
||||
if ops._in:
|
||||
g_data = json.load(open(ops._in))
|
||||
try:
|
||||
g_data = yaml.load(open(ops._in))
|
||||
except:
|
||||
g_data = json.load(open(ops._in))
|
||||
|
||||
if ops.kj:
|
||||
(k, j) = ops.kj
|
||||
|
||||
Reference in New Issue
Block a user