Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pony
tshistory_supervision
Commits
0c710083dc50
Commit
420ad268
authored
Aug 28, 2019
by
Aurélien Campéas
Browse files
cli: a command to list the series known in upstream and not in the supervision
parent
d0c556923591
Changes
2
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
0c710083
...
@@ -14,6 +14,7 @@ setup(name='tshistory_supervision',
...
@@ -14,6 +14,7 @@ setup(name='tshistory_supervision',
],
],
entry_points
=
{
'tshistory.subcommands'
:
[
entry_points
=
{
'tshistory.subcommands'
:
[
'migrate-supervision-0.5-to-0.6=tshistory_supervision.cli:migrate_supervision_dot_5_to_dot_6'
,
'migrate-supervision-0.5-to-0.6=tshistory_supervision.cli:migrate_supervision_dot_5_to_dot_6'
,
'list-supervised-series-mismatch=tshistory_supervision.cli:list_mismatch'
,
'shell=tshistory_supervision.cli:shell'
'shell=tshistory_supervision.cli:shell'
]},
]},
classifiers
=
[
classifiers
=
[
...
...
tshistory_supervision/cli.py
View file @
0c710083
...
@@ -58,6 +58,26 @@ def migrate_supervision_dot_5_to_dot_6(dburi, name=None, namespace='tsh'):
...
@@ -58,6 +58,26 @@ def migrate_supervision_dot_5_to_dot_6(dburi, name=None, namespace='tsh'):
print
(
'supervised'
,
len
(
categories
[
'supervised'
]))
print
(
'supervised'
,
len
(
categories
[
'supervised'
]))
@
click
.
command
(
name
=
'list-supervised-series-mismatch'
)
@
click
.
argument
(
'db-uri'
)
@
click
.
option
(
'--namespace'
,
default
=
'tsh'
)
def
list_mismatch
(
db_uri
,
namespace
=
'tsh'
):
e
=
create_engine
(
find_dburi
(
db_uri
))
tsh
=
timeseries
(
namespace
)
series
=
set
(
tsh
.
list_series
(
e
))
upstream
=
set
(
tsh
.
upstream
.
list_series
(
e
))
diff
=
upstream
-
series
if
not
diff
:
print
(
'no mismatch'
)
return
print
(
f
'found
{
len
(
diff
)
}
series in upstream'
)
for
name
in
sorted
(
diff
):
assert
(
False
,
True
)
==
(
tsh
.
exists
(
e
,
name
),
tsh
.
upstream
.
exists
(
e
,
name
))
print
(
name
)
@
click
.
command
(
name
=
'shell'
)
@
click
.
command
(
name
=
'shell'
)
@
click
.
argument
(
'db-uri'
)
@
click
.
argument
(
'db-uri'
)
@
click
.
option
(
'--namespace'
,
default
=
'tsh'
)
@
click
.
option
(
'--namespace'
,
default
=
'tsh'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment