Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
808cdaec
Commit
808cdaec
authored
8 years ago
by
Pavel Kácha
Browse files
Options
Downloads
Patches
Plain Diff
Python3 compatibility - iterator/sequence context, less unicode (thx to Radko Krkos)
parent
95b418a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
warden3/warden_client/warden_client.py
+2
-2
2 additions, 2 deletions
warden3/warden_client/warden_client.py
warden3/warden_client/warden_client_examples.py
+1
-1
1 addition, 1 deletion
warden3/warden_client/warden_client_examples.py
with
3 additions
and
3 deletions
warden3/warden_client/warden_client.py
+
2
−
2
View file @
808cdaec
...
@@ -532,7 +532,7 @@ class Client(object):
...
@@ -532,7 +532,7 @@ class Client(object):
"""
Send out
"
events
"
list to server, retrying on server errors.
"""
Send out
"
events
"
list to server, retrying on server errors.
"""
"""
ev
=
events
ev
=
events
idx_xlat
=
range
(
len
(
ev
))
idx_xlat
=
list
(
range
(
len
(
ev
))
)
err
=
Error
()
err
=
Error
()
retry
=
retry
or
self
.
retry
retry
=
retry
or
self
.
retry
attempt
=
retry
attempt
=
retry
...
@@ -550,7 +550,7 @@ class Client(object):
...
@@ -550,7 +550,7 @@ class Client(object):
res
.
errors
.
sort
(
key
=
itemgetter
(
"
error
"
))
res
.
errors
.
sort
(
key
=
itemgetter
(
"
error
"
))
for
e
in
res
.
errors
:
for
e
in
res
.
errors
:
errno
=
e
[
"
error
"
]
errno
=
e
[
"
error
"
]
evlist
=
e
.
get
(
"
events
"
,
range
(
len
(
ev
)))
# none means all
evlist
=
e
.
get
(
"
events
"
,
list
(
range
(
len
(
ev
)))
)
# none means all
if
errno
<
500
or
not
attempt
:
if
errno
<
500
or
not
attempt
:
# Fatal error or last try, translate indices
# Fatal error or last try, translate indices
# to original and prepare for returning to caller
# to original and prepare for returning to caller
...
...
This diff is collapsed.
Click to expand it.
warden3/warden_client/warden_client_examples.py
+
1
−
1
View file @
808cdaec
...
@@ -56,7 +56,7 @@ def gen_random_idea(client_name="cz.example.warden.test"):
...
@@ -56,7 +56,7 @@ def gen_random_idea(client_name="cz.example.warden.test"):
def
randip6
():
def
randip6
():
return
[
rand6ip
,
geniprange
(
rand6ip
),
rand6cidr
][
randint
(
0
,
2
)]()
return
[
rand6ip
,
geniprange
(
rand6ip
),
rand6cidr
][
randint
(
0
,
2
)]()
def
randstr
(
charlist
=
string
.
letters
,
maxlen
=
32
,
minlen
=
1
):
def
randstr
(
charlist
=
string
.
ascii_
letters
,
maxlen
=
32
,
minlen
=
1
):
return
''
.
join
(
choice
(
charlist
)
for
i
in
range
(
randint
(
minlen
,
maxlen
)))
return
''
.
join
(
choice
(
charlist
)
for
i
in
range
(
randint
(
minlen
,
maxlen
)))
event
=
{
event
=
{
...
...
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