summaryrefslogtreecommitdiffstats
path: root/src/software
diff options
context:
space:
mode:
authorAles Ledvinka <aledvink@redhat.com>2014-04-11 14:20:00 +0200
committerAles Ledvinka <aledvink@redhat.com>2014-04-11 14:20:00 +0200
commite83d5dc50a95980e5f0085e931078ecf448f91eb (patch)
treeebacaf09b64c378da9cf42b32237179ca0147dac /src/software
parentbbf83307946d07c7189ba7bfe90b56797c11ef39 (diff)
downloadopenlmi-providers-e83d5dc50a95980e5f0085e931078ecf448f91eb.tar.gz
openlmi-providers-e83d5dc50a95980e5f0085e931078ecf448f91eb.tar.xz
openlmi-providers-e83d5dc50a95980e5f0085e931078ecf448f91eb.zip
python2.6 software provider
Diffstat (limited to 'src/software')
-rw-r--r--src/software/lmi/software/LMI_SoftwareIdentityResource.py4
-rw-r--r--src/software/lmi/software/LMI_SoftwareJob.py4
-rw-r--r--src/software/lmi/software/core/IdentityFileCheck.py4
-rw-r--r--src/software/lmi/software/core/InstallationService.py10
-rw-r--r--src/software/lmi/software/core/Job.py8
-rw-r--r--src/software/lmi/software/yumdb/process.py4
-rw-r--r--src/software/lmi/software/yumdb/repository.py4
7 files changed, 19 insertions, 19 deletions
diff --git a/src/software/lmi/software/LMI_SoftwareIdentityResource.py b/src/software/lmi/software/LMI_SoftwareIdentityResource.py
index 8fa7e03..dd1c4a9 100644
--- a/src/software/lmi/software/LMI_SoftwareIdentityResource.py
+++ b/src/software/lmi/software/LMI_SoftwareIdentityResource.py
@@ -240,9 +240,9 @@ class LMI_SoftwareIdentityResource(CIMProvider2):
return ( self.values.RequestStateChange. \
Use_of_Timeout_Parameter_Not_Supported
, out_params)
- if param_requestedstate not in {
+ if param_requestedstate not in set([
self.values.RequestStateChange.RequestedState.Enabled,
- self.values.RequestStateChange.RequestedState.Disabled }:
+ self.values.RequestStateChange.RequestedState.Disabled ]):
return ( self.values.RequestStateChange.Invalid_State_Transition
, out_params)
diff --git a/src/software/lmi/software/LMI_SoftwareJob.py b/src/software/lmi/software/LMI_SoftwareJob.py
index 59a56c2..29749c4 100644
--- a/src/software/lmi/software/LMI_SoftwareJob.py
+++ b/src/software/lmi/software/LMI_SoftwareJob.py
@@ -233,8 +233,8 @@ class LMI_SoftwareJob(CIMProvider2):
"""
job = Job.object_path2job(object_name)
try:
- if param_requestedstate not in {
- self.values.RequestStateChange.RequestedState.Terminate }:
+ if param_requestedstate not in set([
+ self.values.RequestStateChange.RequestedState.Terminate ]):
raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER,
"Valid RequestedState can by only Terminate (%d)" %
self.values.RequestStateChange.RequestedState.Terminate)
diff --git a/src/software/lmi/software/core/IdentityFileCheck.py b/src/software/lmi/software/core/IdentityFileCheck.py
index 8453475..c3ca7f0 100644
--- a/src/software/lmi/software/core/IdentityFileCheck.py
+++ b/src/software/lmi/software/core/IdentityFileCheck.py
@@ -952,9 +952,9 @@ def file_check2model(file_check, keys_only=True, model=None, job=None):
if not keys_only:
model.path.update( #pylint: disable=E1103
- {k: None for k in ("Name", "SoftwareElementID",
+ dict((k, None) for k in ("Name", "SoftwareElementID",
"SoftwareElementState", "TargetOperatingSystem", "Version",
- "CheckID")})
+ "CheckID")))
model['Name'] = file_check.path
model['SoftwareElementID'] = file_check.pkg_info.nevra
diff --git a/src/software/lmi/software/core/InstallationService.py b/src/software/lmi/software/core/InstallationService.py
index cf64ff8..9bb085b 100644
--- a/src/software/lmi/software/core/InstallationService.py
+++ b/src/software/lmi/software/core/InstallationService.py
@@ -175,13 +175,13 @@ class Values(object):
13 : "ScheduleInstallAt",
}
- InstallOptions.supported = {
+ InstallOptions.supported = set([
InstallOptions.Install,
InstallOptions.Update,
InstallOptions.Uninstall,
InstallOptions.Force_installation,
InstallOptions.Repair,
- }
+ ])
class CheckSoftwareIdentity(object):
@@ -681,7 +681,7 @@ def _install_or_remove_check_params(
elif not isinstance(install_options, list):
raise InstallationError(values.Unspecified_Error,
"InstallOptions must be a list of uint16 values.")
- options = {p for p in install_options}
+ options = set([p for p in install_options])
if options - supported_options:
raise InstallationError(values.Unspecified_Error,
@@ -700,10 +700,10 @@ def _install_or_remove_check_params(
"install option \"%s\" can not have any"
" associated value: %s" % (opt, val))
_check_target_and_collection(env, method, target, collection)
- exclusive = [opt for opt in options if opt in {
+ exclusive = [opt for opt in options if opt in set([
values.InstallOptions.Install,
values.InstallOptions.Update,
- values.InstallOptions.Uninstall }]
+ values.InstallOptions.Uninstall ])]
if len(exclusive) > 1:
raise InstallationError(values.Unspecified_Error,
"specified more than one mutually exclusive option at once: {%s}" %
diff --git a/src/software/lmi/software/core/Job.py b/src/software/lmi/software/core/Job.py
index 3154fb7..05a684b 100644
--- a/src/software/lmi/software/core/Job.py
+++ b/src/software/lmi/software/core/Job.py
@@ -672,8 +672,8 @@ def object_path2job(op):
"Missing InstanceID key property.")
instid = op['InstanceID']
match = util.RE_INSTANCE_ID.match(instid)
- if not match or match.group('clsname').lower() not in {
- c.lower() for c in JOB_CLASS_NAMES}:
+ if not match or match.group('clsname').lower() not in set([
+ c.lower() for c in JOB_CLASS_NAMES]):
raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER,
"InstanceID must start with one of {%s} prefixes."
" And end with positive integer." % (
@@ -709,8 +709,8 @@ def modify_instance(instance):
"deleteoncompletion" : "delete_on_completion",
"timebeforeremoval" : "time_before_removal"
}
- metadata_props = {"name"}
- reschedule_props = {"delete_on_completion", "time_before_removal"}
+ metadata_props = set(["name"])
+ reschedule_props = set(["delete_on_completion", "time_before_removal"])
for name, prop in instance.properties.items():
if prop is None:
LOG().warn('property "%s" is None', name)
diff --git a/src/software/lmi/software/yumdb/process.py b/src/software/lmi/software/yumdb/process.py
index c8e6444..3ad7cdb 100644
--- a/src/software/lmi/software/yumdb/process.py
+++ b/src/software/lmi/software/yumdb/process.py
@@ -126,8 +126,8 @@ class RepoFilterSetter(object):
self._prev_states = None
def __enter__(self):
- self._prev_states = { r.id: r.enabled
- for r in self._yum_base.repos.repos.values()}
+ self._prev_states = dict(( r.id, r.enabled)
+ for r in self._yum_base.repos.repos.values())
if isinstance(self._exclude, (list, tuple, set)):
exclude = ",".join(self._exclude)
else:
diff --git a/src/software/lmi/software/yumdb/repository.py b/src/software/lmi/software/yumdb/repository.py
index 8c16a20..59a9e69 100644
--- a/src/software/lmi/software/yumdb/repository.py
+++ b/src/software/lmi/software/yumdb/repository.py
@@ -63,9 +63,9 @@ def get_prop_from_yum_repo(repo, prop_name):
val = None
elif prop_name == "ready":
val = val()
- elif prop_name in {"arch", "basearch", "releasever"}:
+ elif prop_name in set(["arch", "basearch", "releasever"]):
val = repo.yumvar[prop_name]
- elif prop_name in {"revision", "last_update"}:
+ elif prop_name in set(["revision", "last_update"]):
if repo.enabled and repo.repoXML:
md = repo.repoXML
if prop_name == "last_update":