x[ho UdZddlZddlZddlZddlmZddlmZmZddl m Z ddl m Z ddl mZddlmZd Zd Zd Zd d gedgdZeed<ej,eZeeefdZdede de deddf dZy)z5Mcollective: Install, configure and start mcollectiveN) ConfigObj)subputil)Cloud)Config) MetaSchema) PER_INSTANCEz&/etc/mcollective/ssl/server-public.pemz'/etc/mcollective/ssl/server-private.pemz/etc/mcollective/server.cfgcc_mcollectiveall mcollective)iddistros frequencyactivate_by_schema_keysmetac tj|d}ttj|}|jD]\}}|dk(r#tj||d||d<d|d <.|d k(r#tj||d ||d <d|d <Vt|tr|||<lt|tr4||jvri||<|jD] \} } | ||| <t|||< tj |d |ztj} |j#| tj|| j%dy#t $rI}|j t jk7rtjd|t}Yd}~d}~wwxYw#t $r)}|j t jk(rnYd}~d}~wwxYw)NF)quietz4Did not find file %s (starting with an empty config)z public-certi)modezplugin.ssl_server_publicsslsecurityproviderz private-certizplugin.ssl_server_privatez%s.old)rload_binary_filerioBytesIOIOErrorerrnoENOENTLOGdebugitems write_file isinstancestrdictsectionscopywritegetvalue) config server_cfg pubcert_file pricert_file old_contentsmcollective_configecfg_namecfgovcontentss A/usr/lib/python3/dist-packages/cloudinit/config/cc_mcollective.py configurer5(s -,,ZuE &rzz,'?@ 8 # } $ OOL#E :=I 9 :5: 1 2  ' OOL#E :>J : ;5: 1 2#s#/2"8,C$(#5#>#>>35&x0IIK8DAq67&x038033x"8,-80  *h*56zz|HX&OOJ 1 1 3%@_ - 77ell "  IIF "+ -J  77ell "   s/5E-G- F?6>F::F? G4 G//G4namer0cloudargsreturncd|vrtjd|y|d}|jjdgd|vrt |dt j gddy)Nr z?Skipping module named %s, no 'mcollective' key in configurationconf)r()servicer restartF)capture)rrdistroinstall_packagesr5r)r6r0r7r8mcollective_cfgs r4handlerBesiC M   -(O LL!!=/2 01 II3UC)__doc__rrlogging configobjr cloudinitrrcloudinit.cloudrcloudinit.configrcloudinit.config.schemarcloudinit.settingsr PUBCERT_FILE PRICERT_FILE SERVER_CFGr__annotations__ getLogger__name__rr5r"listrBrCr4rTs<  !#.+7 8 *  w - jg!  :AzDD6D%DtDDrC