܍~c UdZddlmZddlmZddlmZddlmZddl m Z ddl m Z m Z ddlmZd Zd d d ed dgeedgdgdZe ed<e eZddgZdgZdZdZedddfdZdede dedededdf dZdS) z*Spacewalk: Install and configure spacewalk)Logger)dedent)subp)Cloud)Config) MetaSchema get_meta_doc) PER_INSTANCEaThis module installs spacewalk and applies basic configuration. If the ``spacewalk`` config key is present spacewalk will be installed. The server to connect to after installation must be provided in the ``server`` in spacewalk configuration. A proxy to connect through and a activation key may optionally be specified. For more information about spacewalk see: https://fedorahosted.org/spacewalk/ cc_spacewalk SpacewalkzInstall and configure spacewalkrhelfedoraz spacewalk: server: proxy: activation_key: spacewalk)idnametitle descriptiondistros frequencyexamplesactivate_by_schema_keysmetaredhatz rhn-setupz'/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERTcd} tjddgdd}n(#tj$r}|jdkrYd}~nd}~wwxYw|S)NFzrhn-profile-syncz --verbosecaptureT)rProcessExecutionError exit_code)already_registeredes ?/usr/lib/python3/dist-packages/cloudinit/config/cc_spacewalk.py is_registeredr#3s~ %{3UCCCC!  % ;!         sA ?ANc||d||dg}|dd|zg|dt|g|r$|dt|g|r$|dt|g|r$|dt|gtj|d dS) Nz;Registering using `rhnreg_ks` profile '%s' into server '%s' rhnreg_ksz --serverUrlzhttps://%s/XMLRPCz --profilenamez--proxyz --sslCACertz--activationkeyFr)infoextendstrr)server profile_name ca_cert_pathproxylogactivation_keycmds r" do_registerr0As   I     -CJJ 2V;<===JJ\!2!23444 , Is5zz*+++7 M3|#4#45666= %s>':':;<<<Ic5!!!!!!rcfgcloudr-argsreturnc d|vr|d|dS|d}|d}|r|jtt sZt ||jdj |d||ddSdS|d |dS) Nrz=Skipping module named %s, no 'spacewalk' key in configurationr)T)fqdnr,r.)r,r-r.zOSkipping module named %s, 'spacewalk/server' key was not found in configuration) debuggetdistroinstall_packagesrequired_packagesr#r0 datasource get_hostnamehostname)rr2r3r-r4spacewalk_servers r"handlerA[s # K      k Cwwx((  %%&7888    --4-88Aggg&&"ww'788           .      r1)__doc__loggingrtextwrapr cloudinitrcloudinit.cloudrcloudinit.configrcloudinit.config.schemarr cloudinit.settingsr MODULE_DESCRIPTIONr__annotations__rr<def_ca_cert_pathr#r0r(listrAr1r"rOs000!!!!!!######<<<<<<<<++++++   .%!    !,}#j( ,t   X  M<   ""   """"4   #( /5 =A        r1