Server IP : 15.235.198.142 / Your IP : 216.73.216.235 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/landscape/lib/ |
Upload File : |
import json import logging import os 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( f"Error attempting to read JSON from {config.juju_filename}", ) return None juju_info["api-addresses"] = juju_info["api-addresses"].split() return juju_info