FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-libjuju/examples/future.py at test-comment · aieri/python-libjuju · GitHub
aieri
python-libjuju
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-libjuju
/
examples
/
future.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (39 loc) · 1.04 KB
Breadcrumbs
python-libjuju
/
examples
/
future.py
Copy path
File metadata and controls
48 lines (39 loc) · 1.04 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
"""
This example doesn't work - it demonstrates features that don't exist yet.
"""
import
asyncio
import
logging
from
juju
.
model
import
Model
from
juju
import
loop
async
def
main
():
model
=
Model
()
await
model
.
connect_current
()
await
model
.
reset
(
force
=
True
)
goal_state
=
Model
.
from_yaml
(
'bundle-like-thing'
)
ubuntu_app
=
await
model
.
deploy
(
'ubuntu-0'
,
application_name
=
'ubuntu'
,
series
=
'trusty'
,
channel
=
'stable'
,
)
ubuntu_app
.
on_unit_added
(
callback
=
lambda
unit
:
True
)
await
model
.
deploy
(
'nrpe-11'
,
application_name
=
'nrpe'
,
series
=
'trusty'
,
channel
=
'stable'
,
num_units
=
0
,
)
await
model
.
add_relation
(
'ubuntu'
,
'nrpe'
,
)
result
,
ok
=
await
model
.
block_until
(
lambda
:
model
.
matches
(
goal_state
),
timeout
=
600
)
if
__name__
==
'__main__'
:
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
ws_logger
=
logging
.
getLogger
(
'websockets.protocol'
)
ws_logger
.
setLevel
(
logging
.
INFO
)
loop
.
run
(
main
())
Back
|
FazBrowse Home
|
New Git URL