Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jiffybox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Plugins
jiffybox
Commits
092ee25b
Commit
092ee25b
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Fix Python 3 compatibility
parent
0119b22f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
action_plugins/jiffybox.py
+3
-3
3 additions, 3 deletions
action_plugins/jiffybox.py
with
3 additions
and
3 deletions
action_plugins/jiffybox.py
+
3
−
3
View file @
092ee25b
...
@@ -95,7 +95,7 @@ class ActionModule(ActionBase):
...
@@ -95,7 +95,7 @@ class ActionModule(ActionBase):
raise
ae
(
'
No result from JiffyBox API
'
)
raise
ae
(
'
No result from JiffyBox API
'
)
decoder
=
json
.
JSONDecoder
()
decoder
=
json
.
JSONDecoder
()
content
=
decoder
.
decode
(
request_result
.
content
)
content
=
decoder
.
decode
(
request_result
.
content
.
decode
(
'
utf8
'
)
)
if
not
content
[
'
result
'
]:
if
not
content
[
'
result
'
]:
msg
=
content
[
'
messages
'
]
msg
=
content
[
'
messages
'
]
raise
ae
(
'
%s
'
%
msg
)
raise
ae
(
'
%s
'
%
msg
)
...
@@ -104,7 +104,7 @@ class ActionModule(ActionBase):
...
@@ -104,7 +104,7 @@ class ActionModule(ActionBase):
def
_load_objects
(
self
,
type
,
path
):
def
_load_objects
(
self
,
type
,
path
):
display
.
vv
(
"
Reading %s from JiffyBox
"
%
type
)
display
.
vv
(
"
Reading %s from JiffyBox
"
%
type
)
changed
=
False
changed
=
False
if
not
self
.
vars
.
has_key
(
'
_jiffybox_
'
+
type
)
:
if
'
_jiffybox_
'
+
type
not
in
self
.
vars
:
changed
=
True
changed
=
True
self
.
vars
.
__setitem__
(
'
_jiffybox_
'
+
type
,
self
.
_request
(
path
))
self
.
vars
.
__setitem__
(
'
_jiffybox_
'
+
type
,
self
.
_request
(
path
))
return
changed
,
self
.
vars
.
get
(
'
_jiffybox_
'
+
type
)
return
changed
,
self
.
vars
.
get
(
'
_jiffybox_
'
+
type
)
...
@@ -128,7 +128,7 @@ class ActionModule(ActionBase):
...
@@ -128,7 +128,7 @@ class ActionModule(ActionBase):
self
.
load_devices
()
self
.
load_devices
()
self
.
load_ips
()
self
.
load_ips
()
for
block
in
self
.
ips
:
for
block
in
self
.
ips
:
if
s
elf
.
ips
[
block
].
has_key
(
str
(
ip
.
get
(
'
id
'
)))
:
if
s
tr
(
ip
.
get
(
'
id
'
))
in
self
.
ips
[
block
]
:
return
self
.
devices
[
block
]
return
self
.
devices
[
block
]
return
False
return
False
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment