%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj <
| Server IP : 212.252.79.165 / Your IP : 216.73.216.45 [ Web Server : Apache System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64 User : cehaburo ( 1001) PHP Version : 8.1.33 Disable Function : exec,passthru,shell_exec,system Domains : 48 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/landscape/lib/ |
Upload File : |
from __future__ import absolute_import
import os
import json
import logging
from landscape.lib.fs import read_text_file
def get_juju_info(config):
"""
Returns available Juju info or C{None} if the path referenced from
L{config} is not a valid file.
"""
if not os.path.exists(config.juju_filename):
return
json_contents = read_text_file(config.juju_filename)
try:
juju_info = json.loads(json_contents)
# Catch any error the json lib could throw, because we don't know or
# care what goes wrong - we'll display a generic error message and
# return None in any case.
except Exception:
logging.exception(
"Error attempting to read JSON from %s" % config.juju_filename)
return None
juju_info["api-addresses"] = juju_info["api-addresses"].split()
return juju_info