ó oBú]c @sídZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZd d gZi d d 6d d6dd6edƒd6ed6edƒgd6e d6dd6iidd6iidd6idd6iidd6edƒd6d 6idd6dd6dd6d6d 6d dgd!6ed"6d#6d$d%6d&6idd6ed'ƒd6d(6d 6gd!6d$d)6ed"6d*6d 6ZeeƒZe jeƒZd+„Zd,„Zd-„Zd.„Zd/„Zd0„ZdS(1s5zypper_add_repo: Add zyper repositories to the systemiÿÿÿÿN(t string_types(tdedent(tget_schema_doc(tlog(t PER_ALWAYS(tutiltopensusetslestcc_zypper_add_repotidt ZypperAddRepotnames5Configure zypper behavior and add zypper repositoriesttitles Configure zypper behavior by modifying /etc/zypp/zypp.conf. The configuration writer is "dumb" and will simply append the provided configuration options to the configuration file. Option settings that may be duplicate will be resolved by the way the zypp.conf file is parsed. The file is in INI format. Add repositories to the system. No validation is performed on the repository file entries, it is assumed the user is familiar with the zypper repository file format.t descriptiontdistross¾ zypper: repos: - id: opensuse-oss name: os-oss baseurl: http://dl.opensuse.org/dist/leap/v/repo/oss/ enabled: 1 autorefresh: 1 - id: opensuse-oss-update name: os-oss-up baseurl: http://dl.opensuse.org/dist/leap/v/update # any setting per # https://en.opensuse.org/openSUSE:Standards_RepoInfo # enable and autorefresh are on by default config: reposdir: /etc/zypp/repos.dir servicesdir: /etc/zypp/services.d download.use_deltarpm: true # any setting in /etc/zypp/zypp.conf texamplest frequencytobjectttypetarraytstrings¶ The unique id of the repo, used when writing /etc/zypp/repos.d/.repo.turitformatsThe base repositoy URLtbaseurlt propertiestrequiredtadditionalPropertiestitemsitminItemstrepossn Any supported zypo.conf key is written to /etc/zypp/zypp.conf'tconfigt minPropertiestzyppercCs|jddƒ}|S(Nt t_(treplace(trepo_id((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_zypper_add_repo.pyt_canonicalize_idfscCsut|tƒr|rdSdSt|ttfƒrXdjg|D]}t|ƒ^q?ƒSt|tƒsqt|ƒS|S(Niis (t isinstancetbooltlistttupletjoint_format_repo_valueRtstr(tvaltv((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_zypper_add_repo.pyR+ks& cCs`tjƒ}i||£s tenabledt autorefresht1iÿÿÿÿi(t enumeratetsett differencetLOGtwarningR*tgetR%tostpathtexiststinfotdictRR6Rt write_file( Rtrepo_base_patht valid_repostindextuser_repo_configt missing_keysR$t canon_repo_idt repo_fn_pthR2tfieldt repo_datat repo_blob((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_zypper_add_repo.pyt _write_repos‚s>!       cCsÖ|s dSd}tj|ƒ}dg}xi|jƒD][\}}|dkrpd}|d7}tj|ƒq5n|r5|jd||fƒq5q5Wt|ƒdkr¼|d j|ƒ}n|}tj||ƒdS( s@Write to the default zypp configuration file /etc/zypp/zypp.confNs/etc/zypp/zypp.confs# Added via cloud.cfgt configdirs5Changing the location of the zypper configuration is s+not supported, skipping "configdir" settings%s=%sis ( Rt load_fileRRBRCtappendtlenR*RJ(t zypper_configt zypp_configtzypp_conf_contentt new_settingstsettingtvaluetmsgt new_config((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_zypper_add_repo.pyt_write_zypp_config³s"    c Cs‘|jdƒ}|s)tjd|ƒdS|jdƒ}|sRtjd|ƒdS|jdiƒ}|jddƒ}t|ƒt||ƒdS(NR sBSkipping module named %s, no 'zypper' relevant configuration foundRs8Skipping module named %s, no 'repos' configuration foundRtreposdirs/etc/zypp/repos.d/(RDRBtdebugRbRU( R tcfgt_cloudRt_argstzypper_sectionRRZRK((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_zypper_add_repo.pythandleÉs   (t__doc__R/REtsixRttextwrapRtcloudinit.config.schemaRt cloudinitRtloggingtcloudinit.settingsRRRtTruetFalsetschemat getLoggert__name__RBR%R+R6RURbRi(((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_zypper_add_repo.pytsn           1