summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_rh_subscription.py
AgeCommit message (Collapse)Author
2021-01-20Use proper spelling for Red Hat (#778)Dan Kenigsberg
The company name has two distinct words. Signed-off-by: Dan Kenigsberg <danken@redhat.com>
2020-06-08Move subp into its own module. (#416)Scott Moser
This was painful, but it finishes a TODO from cloudinit/subp.py. It moves the following from util to subp: ProcessExecutionError subp which target_path I moved subp_blob_in_tempfile into cc_chef, which is its only caller. That saved us from having to deal with it using write_file and temp_utils from subp (which does not import any cloudinit things now). It is arguable that 'target_path' could be moved to a 'path_utils' or something, but in order to use it from subp and also from utils, we had to get it out of utils.
2019-01-28flake8: use ==/!= to compare str, bytes, and int literalsParide Legovini
2018-07-21pylint: Fix pylint warnings reported in pylint 2.0.0.Scott Moser
Pylint 2.0.0 was recently released and complains more about logging-not-lazy than it used to. I've fixed those warnings, here. The changes in rh_subscription are more extensive. pylint may be complaining incorrectly there, but the tests were not correctly un-doing all of their mock/patching. This cleans those up and makes pylint happy.
2018-04-19pylint: pay attention to unused variable warnings.Scott Moser
This enables warnings produced by pylint for unused variables (W0612), and fixes the existing errors.
2018-01-26Fix potential cases of uninitialized variables.Chad Smith
While addressing undeclared variable in 'cloud-init status', I also fixed the errors raised by automated code reviews against cloud-init master at https://lgtm.com/projects/g/cloud-init/cloud-init/alerts The following items are addressed:  * Fix 'cloud-init status':     * Only report 'running' state when any stage in /run/cloud-init/status.json has a start time but no finished time. Default start time to 0 if null.     * undeclared variable 'reason' now reports 'Cloud-init enabled by systemd cloud-init-generator' when systemd enables cloud-init  * cc_rh_subscription.py util.subp return values aren't set during if an exception is raised, use ProcessExecution as e instead.  * distros/freebsd.py:    * Drop repetitive looping over ipv4 and ipv6 nic lists.    * Initialize bsddev to 'NOTFOUND' in the event that no devs are discovered    * declare nics_with_addresses = set() in broader scope outside check_downable conditional  * cloudinit/util.py: Raise TypeError if mtype parameter isn't string, iterable or None. LP: #1744796
2017-11-10rh_subscription: Perform null checks for enabled and disabled repos.Dave Mulford
The rh_subscription module doesn't perform null checks when attempting to iterate on the enabled and disable repos arrays. When only one is specified, cloud-init fails to run.
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2016-11-22cloudinit/config/cc_rh_subscription.py: Remove repos before addingBrent Baude
A user has pointed out that upon set up of a machine, users typically remove repos (sometimes all of them) and then add repos in. This does make sense for a typical user.
2016-09-30Improve module documentation and doc cleanup.Wesley Wiedenmeier
This adds lots of config module documentation in a standard format. It will greatly improve the content at readthedocs. Additionally: * Add a 'doc' env to tox.ini * Changed default highlight language for sphinx conf from python to yaml most examples in documentation are yaml configs * Updated datasource examples to highlight sh code properly
2016-08-10Add distro tags on config modules that should have itJoshua Harlow
Some of these really won't work to well on non-supporting distros so to avoid further user pain tag this with the supported distros where they should work.
2016-04-06fix tests and hopefully actually workScott Moser
2016-04-06rh_subscription: only check subscription if configuredScott Moser
The rh_subscription config module would attempt to connect to the RHN servers even when no config is provided. Now, instead check to make sure that valid config is provided first. That consists of username and password or a activation key. LP: #1536706
2016-03-04pep8: update formatting to pass pep8 1.4.6 (trusty) and 1.6.2 (xenial)Ryan Harper
make check fails in a trusty sbuild due to different rules on older pep8. Fix formatting to pass in older and newer pep8.
2016-03-03Update pep8 runner and fix pep8 issuesRyan Harper
2015-08-04pep8 fixesScott Moser
2015-06-15cc_rh_subscription: fixes for python3Scott Moser
2015-05-29Corrected spelling error on variable nameBrent Baude
2015-05-28Tightening up an error message and isinstance usage based on feedback from DanBrent Baude
2015-05-27Updated files with upstream review comments thanks to Dan and ScottBrent Baude
2015-05-21This commit consists of three things based on feedback from smosher:Brent Baude
cc_rh_subscription: Use of self.log.info limited, uses the util.subp for subprocesses, removed full path for subscription-manager cloud-config-rh_subscription.txt: A heavily commented example file on how to use rh_subscription and its main keys test_rh_subscription.py: a set of unittests for rh_subscription
2015-05-14This patch adds a cloud-init plugin for helping users registerBrent Baude
and subscribe their RHEL based systems. As inputs, it can take: - user and password OR activation key and org | requires on of the two pair - auto-attach: True or False | optional - service-level: <string> | optional - add-pool [list, of, pool, ids] | optional - enable-repos [list, of, yum, repos, to, enable] | optional - disable-repos [list, of, yum, repos, to, disable] | optional You can also pass the following to influence your registration via rhsm.conf: - rhsm-baseurl | optional - server-hostname | optional