X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Fexamples%2Fconnect_current_model.py;fp=modules%2Flibjuju%2Fexamples%2Fconnect_current_model.py;h=0000000000000000000000000000000000000000;hp=b46a09c6150b6a45ac01fd7c5115099c6735d664;hb=5aa242fe2d61c2da9fdb29ed65029f3e27b6966d;hpb=e2051cca7dac12aa09f6ed33555dcc4548c4b52b diff --git a/modules/libjuju/examples/connect_current_model.py b/modules/libjuju/examples/connect_current_model.py deleted file mode 100644 index b46a09c..0000000 --- a/modules/libjuju/examples/connect_current_model.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -This is a very basic example that connects to the currently selected model -and prints the number of applications deployed to it. -""" -import logging - -from juju import loop -from juju.model import Model - -log = logging.getLogger(__name__) - - -async def main(): - model = Model() - try: - # connect to the current model with the current user, per the Juju CLI - await model.connect() - print('There are {} applications'.format(len(model.applications))) - finally: - if model.is_connected(): - print('Disconnecting from model') - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.INFO) - loop.run(main())