diff options
author | harlowja <harlowja@virtualbox.rhel> | 2012-06-23 15:06:26 -0700 |
---|---|---|
committer | harlowja <harlowja@virtualbox.rhel> | 2012-06-23 15:06:26 -0700 |
commit | a75e77a8a5b03294eb79dec5d8d1d8e3bf9ba7c1 (patch) | |
tree | 0d352e76dbe8d6315e7b7d58704c178604e35fd9 /cloudinit/util.py | |
parent | 4e938eef6581769c086e417a24206274f26b8a95 (diff) | |
parent | a0f42d8f96248d519e70a86e470868616dea3d6e (diff) | |
download | vyos-cloud-init-a75e77a8a5b03294eb79dec5d8d1d8e3bf9ba7c1.tar.gz vyos-cloud-init-a75e77a8a5b03294eb79dec5d8d1d8e3bf9ba7c1.zip |
Fix a bunch of == None cases
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index baa3def1..2f5ed275 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -157,7 +157,7 @@ class MountFailedError(Exception): pass -def SilentTemporaryFile(**kwargs): +def ExtendedTemporaryFile(**kwargs): fh = tempfile.NamedTemporaryFile(**kwargs) # Replace its unlink with a quiet version # that does not raise errors when the @@ -517,26 +517,6 @@ def del_dir(path): shutil.rmtree(path) -# get gpg keyid from keyserver -def getkeybyid(keyid, keyserver): - # TODO fix this... - shcmd = """ - k=${1} ks=${2}; - exec 2>/dev/null - [ -n "$k" ] || exit 1; - armour=$(gpg --list-keys --armour "${k}") - if [ -z "${armour}" ]; then - gpg --keyserver ${ks} --recv $k >/dev/null && - armour=$(gpg --export --armour "${k}") && - gpg --batch --yes --delete-keys "${k}" - fi - [ -n "${armour}" ] && echo "${armour}" - """ - args = ['sh', '-c', shcmd, "export-gpg-keyid", keyid, keyserver] - (stdout, _stderr) = subp(args) - return stdout - - def runparts(dirp, skip_no_exist=True): if skip_no_exist and not os.path.isdir(dirp): return @@ -928,7 +908,7 @@ def pipe_in_out(in_fh, out_fh, chunk_size=1024, chunk_cb=None): def chownbyid(fname, uid=None, gid=None): - if uid == None and gid == None: + if uid is None and gid is None: return LOG.debug("Changing the ownership of %s to %s:%s", fname, uid, gid) os.chown(fname, uid, gid) |