????
| Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/sos/plugins/ |
| Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/sos/plugins/juju.pyo |
�
Dr^c @ sX d d l Z d d l m Z m Z d d l m Z d � Z d e e f d � � YZ d S( i����N( t Plugint UbuntuPlugin( t loadsc s � f d � } | S( Nc s � � f d � } | S( Nc s� z� yT | j d j � � � } | d d k rF t d j � � � � n � | | | � Wn/ t k
r� } | j d j � | j � � n XWd | j d j � � � Xd S( Ns service {0} stopt statusi s Cannot stop {0} services Cannot stop {0}, exception: {1}s service {0} start( t
call_ext_progt formatt Exceptiont
_log_errort message( t selft argst kwargst resultt ex( t callbackt service( s4 /usr/lib/python2.7/site-packages/sos/plugins/juju.pyt wrapped_f s ( ( R R ( R ( R s4 /usr/lib/python2.7/site-packages/sos/plugins/juju.pyt wrapper s ( ( R R ( ( R s4 /usr/lib/python2.7/site-packages/sos/plugins/juju.pyt ensure_service_is_running s t Jujuc B sk e Z d Z d Z d Z d Z d d d e f d
d d e f g Z d � Z e d
� d � � Z
d � Z RS( s Juju orchestration tool
t jujut virtt sysmgmts
/usr/bin/jujus /usr/bin/juju-runs /snap/bin/jujus export-mongodbs( Export mongodb collections as json filest s generate-bundlesW Generate a YAML bundle of the current environment
(requires juju-deployerizer)c C sZ d } | j | � d } | j | d � y t | � d j � SWn t k
rU g SXd S( Ns juju status --format jsont outputt juju_status_jsont services( R t add_string_as_filet
json_loadst keyst
ValueError( R t cmdt status_json( ( s4 /usr/lib/python2.7/site-packages/sos/plugins/juju.pyt get_deployed_services2 s
s juju-dbc C s@ d } x3 | D]+ } | j d j | � d d j | � �q
Wd S(
Nt relationst environmentst linkednetworkst systemt settingss� /usr/lib/juju/bin/mongoexport --ssl --dbpath=/var/lib/juju/db --db juju --collection {0} --jsonArrayt suggest_filenames {}.json( R"