SMI-S Plugin: Move code to smis_ag.py and smis_vol.py (squashed commits)

 * New script:
    1. smis_ag.py:  Hold AccessGroup related methods
    2. smis_vol.py: Hold Volume related methods
 * Makefile and RPM SPEC file updated for new file smis_ag.py and smis_vol.py.
 * Replaces smis.Smis._vol_id() with smis_vol.vol_id_of_cim_vol()
 * Replaces smis.Smis._property_list_of_id('Volume') with
   smis_vol.cim_vol_id_pros()
 * Replace smis.Smis._cim_vol_pros() with smis_vol.cim_vol_pros()
 * Replace smis.Smis._new_vol() with smis_pool.cim_vol_to_lsm_vol()
 * Moved _vpd83_xxx method into smis_pool.py as it's private used by
   smis_pool.cim_vol_to_lsm_vol()
 * The smis_pool.cim_vol_to_lsm_vol() require caller to provide pool_id and
   systemd_id as they should handled by smis_pool.py and smis_sys.py.
   smis_sys.sys_id_of_cim_vol() is added for this seek.
 * As these two methods will be commonly used across smis_xxx.py,
   move them into utils.py file:
    smis_pool._cim_path_to_path_str()
        -> utils.cim_path_to_path_str()
    smis_pool._path_str_to_cim_path()
        - utils.path_str_to_cim_path()
 * Replace smis.Smis._pi() with SmisCommon.invoke_method().
   * When a exception triggered, invoke_method() will call 'error_handler'
     with argument of: SmisCommon, method_data.
     In this patch, smis_vol.volume_create_error_handler() is the
     error_handler of volume_create(). It's stored in
     smis.Smis._JOB_ERROR_HANDLER[SmisCommon.JOB_RETRIEVE_VOLUME_CREATE]
     so that job_status() could use the same error handler.
   * The invoke_method() also take 'out_handler' parameter which will be
     called if the method finished in SYNC way.
     In this patch, self._new_vol_from_name() is the out_handler of
     volume_create().
 * Moved job id generator and parser into smis_common.py:
    smis.Smis._job_id() -> smis_common.SmisCommon.job_id_of_cim_job()
    smis.Smis._parse_job_id() -> smis_common.SmisCommon.parse_job_id()
 * Move duplicate volume checker method to smis_vol.py as the volume create
   error handler require it while smis_vol.py cannot depend on smis.py:
    smis.Smis._volume_exists        -> smis_vol.volume_name_exists
    smis.Smis._check_for_dupe_vol() -> smis_vol.volume_create_error_handler()
 * Store cim_vol_path data in Volume.plugin_date.
 * Replace
    smis.Smis._get_cim_instance_by_id('Volume', volume.id)
        -> smis_vol.lsm_vol_to_cim_vol_path()
 * Changed smis.Smis._deal_volume_associations_netappe() and
   smis.Smis._deal_volume_associations() to take cim_vol_path only.
 * Replace SmisCommon.get_class_instance() and get_cim_service_path() with:
    SmisCommon.cim_scs_of_sys_id()      CIM_StorageConfigurationService
    SmisCommon.cim_rs_of_sys_id()       CIM_ReplicationService
    SmisCommon.cim_gmms_of_sys_id()     CIM_GroupMaskingMappingService
    SmisCommon.cim_ccs_of_sys_id()      CIM_ControllerConfigurationService
    SmisCommon.cim_hwms_of_sys_id()     CIM_StorageHardwareIDManagementService
 * smis.Smis._cim_spc_of() changed to use system_id instead of cim_sys.path
   to benefit this change.
 * Empty smis_ag.py with license only.
 * Makefile and RPM SPEC file updated.
 * Removed smis._dmtf_init_type_to_lsm(). It has been merged into
   smis_ag._cim_inits_to_lsm_init_id_and_type()
 * Replaced these methods:
    smis.Smis._cim_spc_pros()
        -> smis_ag.cim_spc_pros()
    smis.Smis._cim_inits_to_lsm()
        -> smis_ag._cim_inits_to_lsm_init_id_and_type()
    smis.Smis._cim_spc_to_lsm()
        -> smis_ag.cim_spc_to_lsm_ag()
    smis.Smis._cim_init_of_spc()
        -> cim_init_of_cim_spc_path()
    smis.Smis._cim_init_of_init_mg()
        -> cim_init_of_cim_init_mg_path()
 * Save cim_spc_path or cim_init_mg_path into lsm.AccessGroup.plugin_data
 * Replaces these methods for converting lsm.AccessGroup to
   cim_spc/cim_init_mg:
    smis.Smis._cim_spc_of_id()
        -> smis_ag.lsm_ag_to_cim_spc_path()
    smis.Smis._cim_init_mg_of_id()
        -> smis_ag.lsm_ag_to_cim_init_mg_path()
 * Replace smis.Smis._cim_init_mg_pros() with
   smis_ag.cim_init_mg_pros()

Changes in V2:
 * Fix typo: gernarate -> generate in smis_vol.py.
 * Correct document for smis_vol.volume_name_exists:
    :param name:    Volume ElementName
    -> :param volume_name:    Volume ElementName
 * Fix incorrect variable name in smis_common.SmisCommon.invoke_method():
    msg, datetime.datetime.now().isoformat())
    -> : cmd, datetime.datetime.now().isoformat())
 * Fix typo in smis_common.SmisCommon:
    defination -> definition
    metioned -> motioned
 * Fix incorrect variable in smis.Smis._check_exist_cim_dev_mg():
    cim_gmm.path, **in_params)
        -> cim_gmms_path, **in_params)
 * Add the missing import in smis_ag.py:
    LsmError, ErrorNumber

Changes in V3:
 * Fix debug_path of smis.Smis.plugin_register().
 * PEP8 fix in smis.py.
 * Fix traceback log displaying in SmisCommon.invoke_method().
 * Pylint fix for smis_ag.py and smis_vol.py(both 10/10 point now):
    1. Relative import. Use 'from lsm.plugin.smispy import smis_ag' instead of
       'import smis_ag'
    2. Add module docstring for smis_ag and smis_vol.
    3. Remove unused parameter 'smis_common' of smis_vol.cim_vol_to_lsm_vol().
    4. Renamed long method:
        * smis_ag._cim_inits_to_lsm_init_id_and_type()
            -> smis_ag._init_id_and_type_of()
        * smis_vol._vpd83_in_cim_vol_otherinfo_netapp()
            -> smis_vol._vpd83_netapp()
    5. Renamed short variable name:
        * smis_ag._init_id_and_type_of()
            rc -> cim_inits
        * smis_vol._vpd83_in_cim_vol_name()
            nn -> name_space
            nf -> name_format
        * smis_vol.cim_vol_of_cim_pool_path()
            rc -> needed_cim_vols
        * smis_ag.cim_init_of_cim_spc_path()
            ce -> cim_error
    6. Remove unused variable 'ag_init_ids' in  smis_ag.cim_spc_to_lsm_ag().
    7. Add docstring to these methods:
        * smis_ag.cim_init_mg_to_lsm_ag()
        * smis_ag.cim_spc_to_lsm_ag()
        * smis_vol.vol_id_of_cim_vol()
        * smis_vol._vpd83_of_cim_vol()

Changes in V4:
 * Fix volume-replicate() and volume-resize() invoke output handler:
   When SYNC invoke finished, it should call smis.Smis._new_vol_from_name()
   to generate lsm.Volume object.
 * Add workaround for HP 3PAR bug in _new_vol_from_job():
        Associators() for CIM_ConcreteJob will not return any cim_vols if
        PropertyList argument defined when creating COPY replication.
        As we didn't use PropertyList argument in Associators of
        _new_vol_from_job() in previous code, we didn't hit this problem
        with old code.
 * Fix 'raise_error=False' in these methods to skip CIMError:
    SmisCommon.cim_scs_of_sys_id()
    SmisCommon.cim_rs_of_sys_id()
    SmisCommon.cim_gmms_of_sys_id()
    SmisCommon.cim_ccs_of_sys_id()
    SmisCommon.cim_hwms_of_sys_id()

Signed-off-by: Gris Ge <fge@redhat.com>
Use named constant instead of hardcoded value

The rest of the daemon uses the 'plugin_extension' constant rather than
directly referring to "_lsmplugin"
build-sys: Process 'daemon' dir before 'packaging'

Running 'make install' in the packaging dir tries to write some files to
/usr regardless of the prefix being used, which fails if make install is
ran as non-root. As the daemon dir is listed after the packaging dir,
the daemon will not get installed in this situation as make install will
fail while processing packaging.

The files from packaging/ are not mandatory during
development/local testing, so they can be processed last. make install
will still fail when being run unpriviledged, but at least the daemon
will be installed.
doc: Fix LSM_ERROR_OK typo in API doc

The correct name is LSM_ERR_OK.
doc: Add missing ')' to lsm_volume_name_get API doc
lsm_rest: Use strdup when appropriate
smis_sys.py: Change variable name to not match method

Removes any doubt which value we are returning.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
SMI-S Plugin: pep8 corrections

Signed-off-by: Tony Asleson <tasleson@redhat.com>
SMI-S Plugin: Fix typos

Signed-off-by: Tony Asleson <tasleson@redhat.com>