f UdZddlZddlmZddlmZddlmZddlm Z ddl m Z m Z ddl mZd Zd d d egd eedgdgdZe ed<e eZej$eZddgZdgZdZdZeddfdZdede dededdf dZy)z*Spacewalk: Install and configure spacewalkN)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 spacewalk)rhelfedora openeulerz spacewalk: server: proxy: activation_key: spacewalk)idnametitle descriptiondistros frequencyexamplesactivate_by_schema_keysmetaredhatr z rhn-setupz'/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERTcd} tjddgdd}|S#tj$r}|jdk7rYd}~|Sd}~wwxYw)NFzrhn-profile-syncz --verbosecaptureT)rProcessExecutionError exit_code)already_registeredes ?/usr/lib/python3/dist-packages/cloudinit/config/cc_spacewalk.py is_registeredr#4sc %{3UC!   % % ;;!    s!AA  Ac~tjd||dg}|jdd|zg|jdt|g|r|jdt|g|r|jdt|g|r|jdt|gt j|d y) Nz;Registering using `rhnreg_ks` profile '%s' into server '%s' rhnreg_ksz --serverUrlzhttps://%s/XMLRPCz --profilenamez--proxyz --sslCACertz--activationkeyFr)LOGinfoextendstrr)server profile_name ca_cert_pathproxyactivation_keycmds r" do_registerr0BsHHE -CJJ 2V;<=JJ\!234  Is5z*+ M3|#456 %s>':;<IIc5!rcfgcloudargsreturncd|vrtjd|y|d}|jd}|r||jj t t sRt||jjdj|jd|jdyytjd |y) Nrz=Skipping module named %s, no 'spacewalk' key in configurationr*T)fqdnr-r.)r-r.zOSkipping module named %s, 'spacewalk/server' key was not found in configuration) r&debuggetdistroinstall_packagesrequired_packagesr#r0 datasource get_hostnamehostname)rr2r3r4spacewalk_servers r"handlerAZs# K    k Cwwx( %%&78    --4-8AAggg&"ww'78    .  r1)__doc__loggingtextwrapr cloudinitrcloudinit.cloudrcloudinit.configrcloudinit.config.schemarrcloudinit.settingsr MODULE_DESCRIPTIONr__annotations__ getLogger__name__r&rr<def_ca_cert_pathr#r0r)listrAr1r"rQs0!#<+   .%.   !,}#j( t g! X  M< ""  "0  6 % t  r1