FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-libjuju/examples/localcharm.py at master · VariableDeclared/python-libjuju · GitHub
VariableDeclared
python-libjuju
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-libjuju
/
examples
/
localcharm.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (25 loc) · 759 Bytes
Breadcrumbs
python-libjuju
/
examples
/
localcharm.py
Copy path
File metadata and controls
34 lines (25 loc) · 759 Bytes
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
"""
This example shows how to deploy a local charm. It:
1. Connects to current model.
2. Uploads a local charm (directory on filesystem) to the model.
3. Deploys the uploaded charm.
"""
import
asyncio
import
logging
from
juju
.
model
import
Model
from
juju
import
loop
async
def
main
():
model
=
Model
()
await
model
.
connect
()
# Deploy a local charm using a path to the charm directory
await
model
.
deploy
(
'/home/tvansteenburgh/src/charms/ubuntu'
,
application_name
=
'ubuntu'
,
series
=
'trusty'
,
)
await
model
.
disconnect
()
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