Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
beem
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
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
f71bd7b5
Commit
f71bd7b5
authored
4 years ago
by
Holger
Browse files
Options
Downloads
Patches
Plain Diff
fix updatenode in shell mode
parent
5e53832a
No related branches found
No related tags found
2 merge requests
!5
Taken current version of master branch in the https://github.com/holgern/beem
,
!4
Original changes pushed to master at https://github.com/holgern/beem
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
beem/cli.py
+4
-0
4 additions, 0 deletions
beem/cli.py
beemapi/node.py
+7
-4
7 additions, 4 deletions
beemapi/node.py
tests/beemapi/test_node.py
+9
-0
9 additions, 0 deletions
tests/beemapi/test_node.py
with
21 additions
and
4 deletions
CHANGELOG.rst
+
1
−
0
View file @
f71bd7b5
...
@@ -4,6 +4,7 @@ Changelog
...
@@ -4,6 +4,7 @@ Changelog
------
------
* setproxy function added to Account (thanks to @flugschwein)
* setproxy function added to Account (thanks to @flugschwein)
* addproxy and delproxy added to beempy (thanks to @flugschwein)
* addproxy and delproxy added to beempy (thanks to @flugschwein)
* updatenodes works in shell mode
0.23.0
0.23.0
------
------
...
...
This diff is collapsed.
Click to expand it.
beem/cli.py
+
4
−
0
View file @
f71bd7b5
...
@@ -505,6 +505,10 @@ def updatenodes(show, hive, steem, test, only_https, only_wss):
...
@@ -505,6 +505,10 @@ def updatenodes(show, hive, steem, test, only_https, only_wss):
print
(
t
)
print
(
t
)
if
not
test
:
if
not
test
:
stm
.
set_default_nodes
(
nodes
)
stm
.
set_default_nodes
(
nodes
)
stm
.
rpc
.
nodes
.
set_node_urls
(
nodes
)
stm
.
rpc
.
current_rpc
=
0
stm
.
rpc
.
rpcclose
()
stm
.
rpc
.
rpcconnect
()
@cli.command
()
@cli.command
()
...
...
This diff is collapsed.
Click to expand it.
beemapi/node.py
+
7
−
4
View file @
f71bd7b5
...
@@ -30,6 +30,11 @@ class Node(object):
...
@@ -30,6 +30,11 @@ class Node(object):
class
Nodes
(
list
):
class
Nodes
(
list
):
"""
Stores Node URLs and error counts
"""
"""
Stores Node URLs and error counts
"""
def
__init__
(
self
,
urls
,
num_retries
,
num_retries_call
):
def
__init__
(
self
,
urls
,
num_retries
,
num_retries_call
):
self
.
set_node_urls
(
urls
)
self
.
num_retries
=
num_retries
self
.
num_retries_call
=
num_retries_call
def
set_node_urls
(
self
,
urls
):
if
isinstance
(
urls
,
str
):
if
isinstance
(
urls
,
str
):
url_list
=
re
.
split
(
r
"
,|;
"
,
urls
)
url_list
=
re
.
split
(
r
"
,|;
"
,
urls
)
if
url_list
is
None
:
if
url_list
is
None
:
...
@@ -41,12 +46,10 @@ class Nodes(list):
...
@@ -41,12 +46,10 @@ class Nodes(list):
elif
urls
is
not
None
:
elif
urls
is
not
None
:
url_list
=
[
urls
]
url_list
=
[
urls
]
else
:
else
:
url_list
=
[]
url_list
=
[]
super
(
Nodes
,
self
).
__init__
([
Node
(
x
)
for
x
in
url_list
])
super
(
Nodes
,
self
).
__init__
([
Node
(
x
)
for
x
in
url_list
])
self
.
num_retries
=
num_retries
self
.
num_retries_call
=
num_retries_call
self
.
current_node_index
=
-
1
self
.
current_node_index
=
-
1
self
.
freeze_current_node
=
False
self
.
freeze_current_node
=
False
def
__iter__
(
self
):
def
__iter__
(
self
):
return
self
return
self
...
...
This diff is collapsed.
Click to expand it.
tests/beemapi/test_node.py
+
9
−
0
View file @
f71bd7b5
...
@@ -54,3 +54,12 @@ class Testcases(unittest.TestCase):
...
@@ -54,3 +54,12 @@ class Testcases(unittest.TestCase):
nodes
=
Nodes
([
"
a
"
,
"
b
"
,
"
c
"
],
5
,
5
)
nodes
=
Nodes
([
"
a
"
,
"
b
"
,
"
c
"
],
5
,
5
)
nodes2
=
Nodes
(
nodes
,
5
,
5
)
nodes2
=
Nodes
(
nodes
,
5
,
5
)
self
.
assertEqual
(
nodes
.
url
,
nodes2
.
url
)
self
.
assertEqual
(
nodes
.
url
,
nodes2
.
url
)
nodes2
=
Nodes
([
"
a
"
,
"
b
"
,
"
c
"
],
5
,
5
)
nodes2
.
set_node_urls
([
"
a
"
,
"
c
"
])
self
.
assertEqual
(
nodes
.
url
,
nodes2
.
url
)
next
(
nodes
)
next
(
nodes
)
next
(
nodes
)
next
(
nodes2
)
next
(
nodes2
)
self
.
assertEqual
(
nodes
.
url
,
nodes2
.
url
)
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