summaryrefslogtreecommitdiffstats
path: root/src/software/providers/LMI_SoftwareInstalledPackage.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/software/providers/LMI_SoftwareInstalledPackage.py')
-rw-r--r--src/software/providers/LMI_SoftwareInstalledPackage.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/software/providers/LMI_SoftwareInstalledPackage.py b/src/software/providers/LMI_SoftwareInstalledPackage.py
index 008a47b..5b00508 100644
--- a/src/software/providers/LMI_SoftwareInstalledPackage.py
+++ b/src/software/providers/LMI_SoftwareInstalledPackage.py
@@ -69,6 +69,12 @@ class LMI_SoftwareInstalledPackage(CIMProvider2):
logger.log_debug('Entering %s.get_instance()' \
% self.__class__.__name__)
+ if not "Software" in model:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing Software property.")
+ if not "System" in model:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing System property.")
check_computer_system_op(env, model['System'])
with YumDB.getInstance(env):
pkg = SoftwarePackage.object_path2pkg(env, model['Software'])
@@ -158,9 +164,15 @@ class LMI_SoftwareInstalledPackage(CIMProvider2):
# parse and check arguments
if modify_existing is True:
- raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED,
"MofifyInstance is not supported")
+ if not "Software" in instance:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing Software property.")
+ if not "System" in instance:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing System property.")
check_computer_system_op(env, instance['System'])
with YumDB.getInstance(env) as yb:
@@ -209,6 +221,12 @@ class LMI_SoftwareInstalledPackage(CIMProvider2):
logger.log_debug('Entering %s.delete_instance()' \
% self.__class__.__name__)
+ if not "Software" in instance_name:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing Software property.")
+ if not "System" in instance_name:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing System property.")
check_computer_system_op(env, instance_name['System'])
with YumDB.getInstance(env) as yb:
pkg = SoftwarePackage.object_path2pkg(env, instance_name["Software"])
@@ -335,6 +353,12 @@ class LMI_SoftwareInstalledPackage(CIMProvider2):
% self.__class__.__name__)
failed = []
+ if not "Software" in object_name:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing Software property.")
+ if not "System" in object_name:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing System property.")
with YumDB.getInstance(env) as yb:
pkg = SoftwarePackage.object_path2pkg(env, object_name['Software'])
csum = SoftwareFileCheck.pkg_checksum_type(pkg)
@@ -399,6 +423,12 @@ class LMI_SoftwareInstalledPackage(CIMProvider2):
logger.log_debug('Entering %s.cim_method_update()' \
% self.__class__.__name__)
+ if not "Software" in object_name:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing Software property.")
+ if not "System" in object_name:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND,
+ "Missing System property.")
check_computer_system_op(env, object_name['System'])
with YumDB.getInstance(env) as yb: