From: Alfredo Deza Date: Wed, 13 May 2015 18:25:42 +0000 (-0400) Subject: default to an emtpy list to avoid getting KeyErrors or handling a None. X-Git-Tag: v1.5.24~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48ae3f8e99bc989f5d2f35a5423897c5c77494c3;p=ceph-deploy.git default to an emtpy list to avoid getting KeyErrors or handling a None. This should *never* happen, because the install module will always pass something *unless* it is being explicitly asked not to install anything. Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/centos/install.py b/ceph_deploy/hosts/centos/install.py index 75821e2..6df57f4 100644 --- a/ceph_deploy/hosts/centos/install.py +++ b/ceph_deploy/hosts/centos/install.py @@ -165,7 +165,7 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw): # removed them from `kw` so that we don't mess with other defaults # note: when split packages for ceph land for CentOS, `packages` # can be used. Unused for now. - packages = kw.pop('components', default_components) or default_components # noqa + packages = kw.pop('components', []) # noqa logger = distro.conn.logger # Get some defaults name = kw.pop('name', '%s repo' % reponame) diff --git a/ceph_deploy/hosts/debian/install.py b/ceph_deploy/hosts/debian/install.py index 190e435..bdb3f1b 100644 --- a/ceph_deploy/hosts/debian/install.py +++ b/ceph_deploy/hosts/debian/install.py @@ -156,7 +156,7 @@ def repo_install(distro, repo_name, baseurl, gpgkey, **kw): # removed them from `kw` so that we don't mess with other defaults # note: when split packages for ceph land for Debian/Ubuntu, `packages` # can be used. Unused for now. - packages = kw.pop('components', default_components) or default_components + packages = kw.pop('components', []) # Get some defaults safe_filename = '%s.list' % repo_name.replace(' ', '-') install_ceph = kw.pop('install_ceph', False) diff --git a/ceph_deploy/hosts/rhel/install.py b/ceph_deploy/hosts/rhel/install.py index b0b74d8..9a44cdd 100644 --- a/ceph_deploy/hosts/rhel/install.py +++ b/ceph_deploy/hosts/rhel/install.py @@ -3,14 +3,14 @@ from ceph_deploy.lib import remoto def install(distro, version_kind, version, adjust_repos, **kw): - packages = kw.get('components', default_components) or default_components + packages = kw.get('components', []) pkg_managers.yum_clean(distro.conn) pkg_managers.yum(distro.conn, packages) def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True, **kw): - packages = kw.get('components', default_components) or default_components + packages = kw.get('components', []) repo_url = repo_url.strip('/') # Remove trailing slashes gpg_url_path = gpg_url.split('file://')[-1] # Remove file if present @@ -40,7 +40,7 @@ def mirror_install(distro, repo_url, def repo_install(distro, reponame, baseurl, gpgkey, **kw): # do we have specific components to install? # removed them from `kw` so that we don't mess with other defaults - packages = kw.pop('components', default_components) or default_components + packages = kw.pop('components', []) # Get some defaults name = kw.pop('name', '%s repo' % reponame) diff --git a/ceph_deploy/hosts/suse/install.py b/ceph_deploy/hosts/suse/install.py index 24dce7f..0a11ae4 100644 --- a/ceph_deploy/hosts/suse/install.py +++ b/ceph_deploy/hosts/suse/install.py @@ -129,7 +129,7 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw): # removed them from `kw` so that we don't mess with other defaults # note: when split packages for ceph land for Suse, `packages` # can be used. Unused for now. - packages = kw.pop('components', default_components) or default_components # noqa + packages = kw.pop('components', []) # noqa # Get some defaults name = kw.get('name', '%s repo' % reponame) enabled = kw.get('enabled', 1)