FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ceph-devstack/ceph_devstack/cli.py at main · exkson/ceph-devstack · GitHub
exkson
ceph-devstack
Repository navigation
Code
Pull requests
1
(1)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ceph-devstack
/
ceph_devstack
/
cli.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
54 lines (48 loc) · 1.65 KB
Breadcrumbs
ceph-devstack
/
ceph_devstack
/
cli.py
Copy path
File metadata and controls
54 lines (48 loc) · 1.65 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import
asyncio
import
logging
import
sys
from
pathlib
import
Path
from
ceph_devstack
import
config
,
logger
,
parse_args
,
VERBOSE
from
ceph_devstack
.
requirements
import
check_requirements
from
ceph_devstack
.
resources
.
ceph
import
CephDevStack
def
main
():
args
=
parse_args
(
sys
.
argv
[
1
:])
config
.
load
(
args
.
config_file
)
if
args
.
verbose
:
for
handler
in
logging
.
getLogger
(
"root"
).
handlers
:
if
not
isinstance
(
handler
,
logging
.
FileHandler
):
handler
.
setLevel
(
VERBOSE
)
if
args
.
command
==
"config"
:
if
args
.
config_op
==
"dump"
:
print
(
config
.
dump
())
if
args
.
config_op
==
"get"
:
print
(
config
.
get_value
(
args
.
name
))
elif
args
.
config_op
==
"set"
:
config
.
set_value
(
args
.
name
,
args
.
value
)
return
config
[
"args"
]
=
vars
(
args
)
data_path
=
Path
(
config
[
"data_dir"
]).
expanduser
()
data_path
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
obj
=
CephDevStack
()
async
def
run
():
if
not
await
asyncio
.
gather
(
check_requirements
(),
obj
.
check_requirements
(),
):
logger
.
error
(
"Requirements not met!"
)
sys
.
exit
(
1
)
if
args
.
command
==
"doctor"
:
return
elif
args
.
command
==
"wait"
:
return
await
obj
.
wait
(
container_name
=
args
.
container
)
elif
args
.
command
==
"logs"
:
return
await
obj
.
logs
(
run_name
=
args
.
run_name
,
job_id
=
args
.
job_id
,
locate
=
args
.
locate
)
else
:
await
obj
.
apply
(
args
.
command
)
return
0
try
:
sys
.
exit
(
asyncio
.
run
(
run
()))
except
KeyboardInterrupt
:
logger
.
debug
(
"Exiting!"
)
Back
|
FazBrowse Home
|
New Git URL