commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-10-16 16:16:07 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.3486 (New) Package is "salt-shaptools" Fri Oct 16 16:16:07 2020 rev:21 rq:842054 version:0.3.10+git.1602832357.46de636 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-09-28 14:29:46.878184926 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.3486/salt-shaptools.changes 2020-10-16 16:16:49.656737585 +0200 @@ -1,0 +2,5 @@ +Thu Oct 15 07:14:20 UTC 2020 - Xabier Arbulu + +- Improve extract_pydbapi to check recursively in subfolders + +--- Old: salt-shaptools-0.3.10+git.1601276788.1869cbd.tar.gz New: salt-shaptools-0.3.10+git.1602832357.46de636.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.6FHy6L/_old 2020-10-16 16:16:50.264737772 +0200 +++ /var/tmp/diff_new_pack.6FHy6L/_new 2020-10-16 16:16:50.268737773 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.10+git.1601276788.1869cbd +Version:0.3.10+git.1602832357.46de636 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ _service ++ --- /var/tmp/diff_new_pack.6FHy6L/_old 2020-10-16 16:16:50.316737788 +0200 +++ /var/tmp/diff_new_pack.6FHy6L/_new 2020-10-16 16:16:50.320737789 +0200 @@ -5,7 +5,7 @@ .git salt-shaptools 0.3.10+git.%ct.%h -1869cbdf21cac302f9a64609ffb1c5e0916bb76c +46de636d92c548924276b07d94eb9267cb25 ++ salt-shaptools-0.3.10+git.1601276788.1869cbd.tar.gz -> salt-shaptools-0.3.10+git.1602832357.46de636.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.10+git.1601276788.1869cbd/salt/modules/hanamod.py new/salt-shaptools-0.3.10+git.1602832357.46de636/salt/modules/hanamod.py --- old/salt-shaptools-0.3.10+git.1601276788.1869cbd/salt/modules/hanamod.py 2020-09-28 09:06:28.0 +0200 +++ new/salt-shaptools-0.3.10+git.1602832357.46de636/salt/modules/hanamod.py 2020-10-16 09:12:37.0 +0200 @@ -27,6 +27,7 @@ import time import re import sys +import os if sys.version_info.major == 2: # pragma: no cover import imp @@ -959,9 +960,17 @@ reload_module(hdb_connector) -def _find_sap_folder(software_folders, folder_pattern): +def _find_sap_folder(software_folders, folder_pattern, recursion_level=0): ''' Find a SAP folder following a recursive approach using the LABEL and LABELIDX files + +Args: +software_folder (list): List of subfolder where the SAP folder is looked for` +folder_pattern (str): Pattern of the LABEL.ASC to look fo +recursion_level (int): Number of subfolder levels to check +Examples: +1 means to check recursively in the subfolder present in software_folders folders +2 means to check in the first subfolder and the folder within ''' for folder in software_folders: label = '{}/{}'.format(folder, LABEL_FILE) @@ -989,6 +998,14 @@ except IOError: LOGGER.debug('%s file not found in %s. Skipping folder', LABELIDX_FILE, folder) +if recursion_level: +subfolders = [os.path.join(folder, found_dir) for found_dir in + os.listdir(folder) if os.path.isdir(os.path.join(folder, found_dir))] +try: +return _find_sap_folder(subfolders, folder_pattern, recursion_level-1) +except SapFolderNotFoundError: +continue + raise SapFolderNotFoundError( 'SAP folder with {} pattern not found'.format(folder_pattern.pattern)) @@ -1023,7 +1040,10 @@ hana_client_pattern = re.compile('^HDB_CLIENT:{}.*:{}:.*'.format( hana_version, current_platform)) try: -hana_client_folder = _find_sap_folder(software_folders, hana_client_pattern) +# recursion_level is set to 1 because the HANA client +# is extracted in SAP_HANA_CLIENT if the file is compressed as SAR +hana_client_folder = _find_sap_folder( +software_folders, hana_client_pattern, recursion_level=1) except SapFolderNotFoundError: raise exceptions.CommandExecutionError('HANA client not found') pydbapi_file = '{}/client/{}'.format(hana_client_folder, name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-09-28 14:29:23 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.4249 (New) Package is "salt-shaptools" Mon Sep 28 14:29:23 2020 rev:20 rq:838191 version:0.3.10+git.1601276788.1869cbd Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-09-22 21:11:22.455939498 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.4249/salt-shaptools.changes 2020-09-28 14:29:46.878184926 +0200 @@ -1,0 +2,5 @@ +Thu Sep 24 12:42:59 UTC 2020 - Xabier Arbulu + +- Implement a new state to set the ENSA version grains data + +--- Old: salt-shaptools-0.3.10+git.1600699854.f5950bc.tar.gz New: salt-shaptools-0.3.10+git.1601276788.1869cbd.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.BUvl8s/_old 2020-09-28 14:29:47.542185502 +0200 +++ /var/tmp/diff_new_pack.BUvl8s/_new 2020-09-28 14:29:47.546185505 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.10+git.1600699854.f5950bc +Version:0.3.10+git.1601276788.1869cbd Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ _service ++ --- /var/tmp/diff_new_pack.BUvl8s/_old 2020-09-28 14:29:47.590185543 +0200 +++ /var/tmp/diff_new_pack.BUvl8s/_new 2020-09-28 14:29:47.590185543 +0200 @@ -5,7 +5,7 @@ .git salt-shaptools 0.3.10+git.%ct.%h -f5950bc96553bbf9e3a1cf437589da17956cb44e +1869cbdf21cac302f9a64609ffb1c5e0916bb76c ++ salt-shaptools-0.3.10+git.1600699854.f5950bc.tar.gz -> salt-shaptools-0.3.10+git.1601276788.1869cbd.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt/modules/netweavermod.py new/salt-shaptools-0.3.10+git.1601276788.1869cbd/salt/modules/netweavermod.py --- old/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt/modules/netweavermod.py 2020-09-21 16:50:54.0 +0200 +++ new/salt-shaptools-0.3.10+git.1601276788.1869cbd/salt/modules/netweavermod.py 2020-09-28 09:06:28.0 +0200 @@ -382,6 +382,30 @@ raise exceptions.CommandExecutionError(err) +def get_ensa_version( +sap_instance, +sid=None, +inst=None, +password=None): +''' +Get currently installed sap instance ENSA version + +sap_instance +Check for specific SAP instances. Available options: ascs, ers. +sid +Netweaver system id (PRD for example) +inst +Netweaver instance number (00 for example) +password +Netweaver instance password +''' +try: +netweaver_inst = _init(sid, inst, password) +return netweaver_inst.get_ensa_version(sap_instance) +except (ValueError, netweaver.NetweaverError) as err: +raise exceptions.CommandExecutionError(err) + + def setup_cwd( software_path, cwd='/tmp/swpm_unattended', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt/states/netweavermod.py new/salt-shaptools-0.3.10+git.1601276788.1869cbd/salt/states/netweavermod.py --- old/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt/states/netweavermod.py 2020-09-21 16:50:54.0 +0200 +++ new/salt-shaptools-0.3.10+git.1601276788.1869cbd/salt/states/netweavermod.py 2020-09-28 09:06:28.0 +0200 @@ -456,3 +456,53 @@ except exceptions.CommandExecutionError as err: ret['comment'] = six.text_type(err) return ret + + +def ensa_version_grains_present( +name, +sid=None, +inst=None, +password=None): +''' +Set the `ensa_version_{sid}_{inst}` grain with the currently installed ENSA version + +name (sap_instance) +Check for specific SAP instances. Available options: ascs, ers. +sid +Netweaver system id (PRD for example) +inst +Netweaver instance number (00 for example) +password +Netweaver instance password +''' + +sap_instance = name +inst = '{:0>2}'.format(inst) + +changes = {} +ret = {'name': name, + 'changes': changes, + 'result': False, + 'comment': ''} + +if __opts__['test']: +ret['result'] = None +ret['comment'] = 'ENSA version grain would be set' +ret['changes'] =
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-09-22 21:10:40 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.4249 (New) Package is "salt-shaptools" Tue Sep 22 21:10:40 2020 rev:19 rq:835847 version:0.3.10+git.1600699854.f5950bc Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-09-15 16:31:27.466778748 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.4249/salt-shaptools.changes 2020-09-22 21:11:22.455939498 +0200 @@ -4 +4,3 @@ -- Add cloud_grains_present state +- Version 0.3.10 + * Add cloud_grains_present state + (jsc#SLE-4047) Old: salt-shaptools-0.3.9+git.1600151923.c265ba1.tar.gz New: salt-shaptools-0.3.10+git.1600699854.f5950bc.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.NzYuzj/_old 2020-09-22 21:11:23.903940766 +0200 +++ /var/tmp/diff_new_pack.NzYuzj/_new 2020-09-22 21:11:23.903940766 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.9+git.1600151923.c265ba1 +Version:0.3.10+git.1600699854.f5950bc Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ _service ++ --- /var/tmp/diff_new_pack.NzYuzj/_old 2020-09-22 21:11:23.947940804 +0200 +++ /var/tmp/diff_new_pack.NzYuzj/_new 2020-09-22 21:11:23.947940804 +0200 @@ -4,8 +4,8 @@ git .git salt-shaptools -0.3.9+git.%ct.%h -c265ba1fc2e0f6f4c6bca2c4a8d8dbac61e93f13 +0.3.10+git.%ct.%h +f5950bc96553bbf9e3a1cf437589da17956cb44e ++ salt-shaptools-0.3.9+git.1600151923.c265ba1.tar.gz -> salt-shaptools-0.3.10+git.1600699854.f5950bc.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.9+git.1600151923.c265ba1/_service new/salt-shaptools-0.3.10+git.1600699854.f5950bc/_service --- old/salt-shaptools-0.3.9+git.1600151923.c265ba1/_service2020-09-15 08:38:43.0 +0200 +++ new/salt-shaptools-0.3.10+git.1600699854.f5950bc/_service 2020-09-21 16:50:54.0 +0200 @@ -4,7 +4,7 @@ git .git salt-shaptools -0.3.9+git.%ct.%h +0.3.10+git.%ct.%h %%VERSION%% diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.9+git.1600151923.c265ba1/salt/__init__.py new/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt/__init__.py --- old/salt-shaptools-0.3.9+git.1600151923.c265ba1/salt/__init__.py 2020-09-15 08:38:43.0 +0200 +++ new/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt/__init__.py 2020-09-21 16:50:54.0 +0200 @@ -6,4 +6,4 @@ :since: 2018-11-30 """ -__version__ = "0.3.1" +__version__ = "0.3.10" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.9+git.1600151923.c265ba1/salt-shaptools.changes new/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt-shaptools.changes --- old/salt-shaptools-0.3.9+git.1600151923.c265ba1/salt-shaptools.changes 2020-09-15 08:38:43.0 +0200 +++ new/salt-shaptools-0.3.10+git.1600699854.f5950bc/salt-shaptools.changes 2020-09-21 16:50:54.0 +0200 @@ -1,7 +1,9 @@ --- Fri Sep 11 14:09:09 UTC 2020 - Xabier Arbulu -- Add cloud_grains_present state +- Version 0.3.10 + * Add cloud_grains_present state + (jsc#SLE-4047) --- Tue Jun 9 13:08:47 UTC 2020 - Xabier Arbulu
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-09-15 16:31:07 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.4249 (New) Package is "salt-shaptools" Tue Sep 15 16:31:07 2020 rev:18 rq:834517 version:0.3.9+git.1600151923.c265ba1 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-06-11 14:52:32.674884170 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.4249/salt-shaptools.changes 2020-09-15 16:31:27.466778748 +0200 @@ -1,0 +2,5 @@ +Fri Sep 11 14:09:09 UTC 2020 - Xabier Arbulu + +- Add cloud_grains_present state + +--- Old: salt-shaptools-0.3.9+git.1591860067.782f9ce.tar.gz New: salt-shaptools-0.3.9+git.1600151923.c265ba1.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.2k6Rte/_old 2020-09-15 16:31:28.378779621 +0200 +++ /var/tmp/diff_new_pack.2k6Rte/_new 2020-09-15 16:31:28.382779625 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.9+git.1591860067.782f9ce +Version:0.3.9+git.1600151923.c265ba1 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ _service ++ --- /var/tmp/diff_new_pack.2k6Rte/_old 2020-09-15 16:31:28.414779655 +0200 +++ /var/tmp/diff_new_pack.2k6Rte/_new 2020-09-15 16:31:28.414779655 +0200 @@ -5,7 +5,7 @@ .git salt-shaptools 0.3.9+git.%ct.%h -782f9ce5394989bd01af7e2f1cd65cc90e47fef1 +c265ba1fc2e0f6f4c6bca2c4a8d8dbac61e93f13 ++ salt-shaptools-0.3.9+git.1591860067.782f9ce.tar.gz -> salt-shaptools-0.3.9+git.1600151923.c265ba1.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.9+git.1591860067.782f9ce/salt/states/crmshmod.py new/salt-shaptools-0.3.9+git.1600151923.c265ba1/salt/states/crmshmod.py --- old/salt-shaptools-0.3.9+git.1591860067.782f9ce/salt/states/crmshmod.py 2020-06-11 09:21:07.0 +0200 +++ new/salt-shaptools-0.3.9+git.1600151923.c265ba1/salt/states/crmshmod.py 2020-09-15 08:38:43.0 +0200 @@ -548,3 +548,55 @@ ret['comment'] = 'Cluster op_defaults configured' ret['result'] = True return ret + + +def cloud_grains_present( +name): +""" +Set the required cloud providers data in the grains. + +These grains are used by the `habootstrap-formula` to identify if the current +execution is being done in the cloud, and if this is the case, set the information +regarding the current cloud provider that is used later to run certain states and +populate the configuration templates. + +All providers: cloud_provider +Only gcp: gcp_instance_id, gcp_instance_name + +name: +This parameter is ignored +""" + +changes = {} +ret = {'name': name, + 'changes': changes, + 'result': False, + 'comment': ''} + +if __opts__['test']: +ret['result'] = None +ret['comment'] = 'Cloud grains would be set' +ret['changes'] = changes +return ret + +cloud_provider = __salt__['crm.detect_cloud']() +__salt__['grains.set']('cloud_provider', cloud_provider) +changes['cloud_provider'] = cloud_provider + +if cloud_provider == 'google-cloud-platform': +gcp_instance_id = __salt__['http.query']( + url='http://metadata.google.internal/computeMetadata/v1/instance/id', +header_dict={"Metadata-Flavor": "Google"})['body'] +__salt__['grains.set']('gcp_instance_id', gcp_instance_id) +changes['gcp_instance_id'] = gcp_instance_id + +gcp_instance_name = __salt__['http.query']( + url='http://metadata.google.internal/computeMetadata/v1/instance/name', +header_dict={"Metadata-Flavor": "Google"})['body'] +__salt__['grains.set']('gcp_instance_name', gcp_instance_name) +changes['gcp_instance_name'] = gcp_instance_name + +ret['changes'] = changes +ret['comment'] = 'Cloud grains set' +ret['result'] = True +return ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.9+git.1591860067.782f9ce/salt/states/hanamod.py new/salt-shaptools-0.3.9+git.1600151923.c265ba1/salt/states/hanamod.py --- old/salt-shaptools-0.3.9+git.1591860067.782f9ce/salt/states/hanamod.py 2020-06-11 09:21:07.0 +0200 +++
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-06-11 14:51:56 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606 (New) Package is "salt-shaptools" Thu Jun 11 14:51:56 2020 rev:17 rq:813402 version:0.3.9+git.1591860067.782f9ce Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-06-09 00:08:00.942004070 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606/salt-shaptools.changes 2020-06-11 14:52:32.674884170 +0200 @@ -1,0 +2,6 @@ +Tue Jun 9 13:08:47 UTC 2020 - Xabier Arbulu + +- Version 0.3.9 + * hana: Fix imp reload usage in py2 + +--- Old: salt-shaptools-0.3.8+git.1591605110.7cde32d.tar.gz New: salt-shaptools-0.3.9+git.1591860067.782f9ce.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.RTh8cQ/_old 2020-06-11 14:52:33.510886710 +0200 +++ /var/tmp/diff_new_pack.RTh8cQ/_new 2020-06-11 14:52:33.514886723 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.8+git.1591605110.7cde32d +Version:0.3.9+git.1591860067.782f9ce Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ _service ++ --- /var/tmp/diff_new_pack.RTh8cQ/_old 2020-06-11 14:52:33.538886796 +0200 +++ /var/tmp/diff_new_pack.RTh8cQ/_new 2020-06-11 14:52:33.538886796 +0200 @@ -4,8 +4,8 @@ git .git salt-shaptools -0.3.8+git.%ct.%h -7cde32d3f868d62dd1f65c9cde41f6929e8362c4 +0.3.9+git.%ct.%h +782f9ce5394989bd01af7e2f1cd65cc90e47fef1 ++ salt-shaptools-0.3.8+git.1591605110.7cde32d.tar.gz -> salt-shaptools-0.3.9+git.1591860067.782f9ce.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.8+git.1591605110.7cde32d/_service new/salt-shaptools-0.3.9+git.1591860067.782f9ce/_service --- old/salt-shaptools-0.3.8+git.1591605110.7cde32d/_service2020-06-08 10:31:50.0 +0200 +++ new/salt-shaptools-0.3.9+git.1591860067.782f9ce/_service2020-06-11 09:21:07.0 +0200 @@ -4,7 +4,7 @@ git .git salt-shaptools -0.3.8+git.%ct.%h +0.3.9+git.%ct.%h %%VERSION%% diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.8+git.1591605110.7cde32d/salt/modules/hanamod.py new/salt-shaptools-0.3.9+git.1591860067.782f9ce/salt/modules/hanamod.py --- old/salt-shaptools-0.3.8+git.1591605110.7cde32d/salt/modules/hanamod.py 2020-06-08 10:31:50.0 +0200 +++ new/salt-shaptools-0.3.9+git.1591860067.782f9ce/salt/modules/hanamod.py 2020-06-11 09:21:07.0 +0200 @@ -26,16 +26,15 @@ import logging import time import re +import sys -try: # pragma: no cover -import importlib as imp -except ImportError: # pragma: no cover +if sys.version_info.major == 2: # pragma: no cover import imp +from salt.ext.six.moves import reload_module from salt import exceptions from salt.utils import files as salt_files - # Import third party libs try: from shaptools import hana @@ -924,12 +923,40 @@ )) -def reload_hdb_connector(): +def reload_hdb_connector(): # pragma: no cover ''' As hdb_connector uses pyhdb or dbapi, if these packages are installed on the fly, we need to reload the connector to import the correct api ''' -imp.reload(hdb_connector) + +def __import_mod(name): +''' +Find more info in: https://docs.python.org/2/library/imp.html +''' +try: +return sys.modules[name] +except KeyError: +pass + +file_ptr, pathname, description = imp.find_module(name) + +try: +return imp.load_module(name, file_ptr, pathname, description) +finally: +# Since we may exit via an exception, close file_ptr explicitly. +if file_ptr: +file_ptr.close() + +if sys.version_info.major == 2: +# pyhdbcli has a cyclical import so it raises an error, but the module is loaded properly +try: +__import_mod('pyhdbcli') +except ImportError: +pass +__import_mod('hdbcli/dbapi') +__import_mod('hdbcli') + +reload_module(hdb_connector) def _find_sap_folder(software_folders, folder_pattern): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore'
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-06-09 00:05:57 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606 (New) Package is "salt-shaptools" Tue Jun 9 00:05:57 2020 rev:16 rq:812471 version:0.3.8+git.1591605110.7cde32d Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-06-04 20:57:40.383263663 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606/salt-shaptools.changes 2020-06-09 00:08:00.942004070 +0200 @@ -1,0 +2,6 @@ +Fri Jun 5 07:46:01 UTC 2020 - nick wang + +- Version 0.3.8 + * DRBD: Avoid CommandExecutionError when estimation sync time not ready + +--- Old: salt-shaptools-0.3.7+git.1591284143.9989ae7.tar.gz New: salt-shaptools-0.3.8+git.1591605110.7cde32d.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.TetCpe/_old 2020-06-09 00:08:02.090008143 +0200 +++ /var/tmp/diff_new_pack.TetCpe/_new 2020-06-09 00:08:02.094008157 +0200 @@ -1,7 +1,7 @@ # # spec file for package salt-shaptools # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,12 +19,12 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.7+git.1591284143.9989ae7 +Version:0.3.8+git.1591605110.7cde32d Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management License:Apache-2.0 -Url:https://github.com/SUSE/%{name} +URL:https://github.com/SUSE/%{name} Source0:%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch ++ _service ++ --- /var/tmp/diff_new_pack.TetCpe/_old 2020-06-09 00:08:02.122008256 +0200 +++ /var/tmp/diff_new_pack.TetCpe/_new 2020-06-09 00:08:02.122008256 +0200 @@ -4,8 +4,8 @@ git .git salt-shaptools -0.3.7+git.%ct.%h -9989ae7bec9c54c17db26aeac3a9f75aac47e27e +0.3.8+git.%ct.%h +7cde32d3f868d62dd1f65c9cde41f6929e8362c4 ++ salt-shaptools-0.3.7+git.1591284143.9989ae7.tar.gz -> salt-shaptools-0.3.8+git.1591605110.7cde32d.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.7+git.1591284143.9989ae7/_service new/salt-shaptools-0.3.8+git.1591605110.7cde32d/_service --- old/salt-shaptools-0.3.7+git.1591284143.9989ae7/_service2020-06-04 17:22:23.0 +0200 +++ new/salt-shaptools-0.3.8+git.1591605110.7cde32d/_service2020-06-08 10:31:50.0 +0200 @@ -4,7 +4,7 @@ git .git salt-shaptools -0.3.7+git.%ct.%h +0.3.8+git.%ct.%h %%VERSION%% diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.7+git.1591284143.9989ae7/salt/modules/drbdmod.py new/salt-shaptools-0.3.8+git.1591605110.7cde32d/salt/modules/drbdmod.py --- old/salt-shaptools-0.3.7+git.1591284143.9989ae7/salt/modules/drbdmod.py 2020-06-04 17:22:23.0 +0200 +++ new/salt-shaptools-0.3.8+git.1591605110.7cde32d/salt/modules/drbdmod.py 2020-06-08 10:31:50.0 +0200 @@ -280,6 +280,37 @@ return True +def _get_json_output_save(command): +''' +A warpper of get json command to acommandate json output issues +''' + +error_str = '"estimated-seconds-to-finish": nan,' +replace_str = '"estimated-seconds-to-finish": 987654321,' +results = __salt__['cmd.run_all'](command) + +if 'retcode' not in results or results['retcode'] != 0: +LOGGER.info("Error running command \"%s\". Error message: %s (%s)", + command, results['stderr'], results['retcode']) +return None + +# https://github.com/LINBIT/drbd-utils/commit/104293030b2c0106b4791edb3eec38b476652a2e +# results['stdout'] is unicode +s_result = str(results['stdout']) +if error_str in s_result: +s_result = s_result.replace(error_str, replace_str) +results['stdout'] = six.text_type(s_result) + +try: +ret = salt.utils.json.loads(results['stdout'], strict=False) + +except ValueError: +raise CommandExecutionError('Error trying to load the json output', +info=results) + +return ret + + def overview(): ''' Show status of the DRBD devices, support two nodes only. @@ -597,18
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-06-04 20:57:19 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606 (New) Package is "salt-shaptools" Thu Jun 4 20:57:19 2020 rev:15 rq:811545 version:0.3.7+git.1591284143.9989ae7 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-05-28 09:19:24.785219121 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606/salt-shaptools.changes 2020-06-04 20:57:40.383263663 +0200 @@ -1,0 +2,8 @@ +Thu Jun 4 09:17:52 UTC 2020 - Xabier Arbulu + +- Version 0.3.7 + * Make diskless sbd and using disks self exclusive (bsc#1172432) + + (jsc#ECO-1965, jsc#SLE-4047) + +--- Old: salt-shaptools-0.3.6.tar.gz New: _service salt-shaptools-0.3.7+git.1591284143.9989ae7.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.X4dwK1/_old 2020-06-04 20:57:41.735267663 +0200 +++ /var/tmp/diff_new_pack.X4dwK1/_new 2020-06-04 20:57:41.735267663 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.6 +Version:0.3.7+git.1591284143.9989ae7 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ _service ++ https://github.com/SUSE/salt-shaptools.git git .git salt-shaptools 0.3.7+git.%ct.%h 9989ae7bec9c54c17db26aeac3a9f75aac47e27e *.tar gz salt-shaptools
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-05-28 09:19:24 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606 (New) Package is "salt-shaptools" Thu May 28 09:19:24 2020 rev:14 rq:809597 version:0.3.6 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-05-15 23:52:44.657593591 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.3606/salt-shaptools.changes 2020-05-28 09:19:24.785219121 +0200 @@ -1,0 +2,14 @@ +Thu May 21 10:14:22 UTC 2020 - Xabier Arbulu + +- Version 0.3.6 + * Add the option to configure the cluster properties and defaults + * Update cluster_configured to add `force` flag + (bsc#1170702) + +--- +Fri May 8 23:37:02 UTC 2020 - Simranpal Singh + +- Version 0.3.5 + * Add support to pass extra tar options + +--- Old: salt-shaptools-0.3.4.tar.gz New: salt-shaptools-0.3.6.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.P0uPaB/_old 2020-05-28 09:19:25.205219891 +0200 +++ /var/tmp/diff_new_pack.P0uPaB/_new 2020-05-28 09:19:25.209219898 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.4 +Version:0.3.6 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ salt-shaptools-0.3.4.tar.gz -> salt-shaptools-0.3.6.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.4/salt/modules/crmshmod.py new/salt-shaptools-0.3.6/salt/modules/crmshmod.py --- old/salt-shaptools-0.3.4/salt/modules/crmshmod.py 2020-03-31 20:02:39.980481668 +0200 +++ new/salt-shaptools-0.3.6/salt/modules/crmshmod.py 2020-05-27 16:14:29.985993498 +0200 @@ -23,6 +23,7 @@ # Import Python libs from __future__ import absolute_import, unicode_literals, print_function import logging +import json from salt import exceptions import salt.utils.path @@ -564,7 +565,8 @@ def configure_load( method, url, -is_xml=None): +is_xml=None, +force=False): ''' Load a part of configuration (or all of it) from a local file or a network URL. The replace method replaces the current configuration with @@ -577,8 +579,10 @@ Used method (check in the description) url Used configuration file url (or path if it's a local file) -is_xml: +is_xml Set to true if the file is an xml file +force +Force commit in the configure load operation CLI Example: @@ -586,11 +590,84 @@ salt '*' crm.configure_load update file.conf ''' -cmd = '{crm_command} configure load {xml}{method} {url}'.format( +cmd = '{crm_command} {force} configure load {xml}{method} {url}'.format( crm_command=CRM_COMMAND, +force='-F' if force else '-n', xml='xml ' if is_xml else '', -method=method, url=url) +method=method, +url=url) + +return __salt__['cmd.retcode'](cmd) + + +def configure_get_property( +option): +''' +Get a cluster property value + +option: +property name to get the value + +Raises: exceptions.CommandExecutionError if the property doesn't exist +''' + +cmd = '{crm_command} configure get_property {property}'.format( +crm_command=CRM_COMMAND, property=option) + +value = __salt__['cmd.run'](cmd).strip() +if "ERROR: configure.get_property:" in value: +raise exceptions.CommandExecutionError(value) +return value + + +def configure_property( +option, +value): +''' +Set a cluster property value + +option: +property name to set the value +value: +property new value +''' + +cmd = '{crm_command} configure property {property}={value}'.format( +crm_command=CRM_COMMAND, property=option, value=json.dumps(value)) +return __salt__['cmd.retcode'](cmd) + + +def configure_rsc_defaults( +option, +value): +''' +Set a cluster rsc default value + +option: +property name to set the value +value: +property new value +''' + +cmd = '{crm_command} configure rsc_defaults {property}={value}'.format( +crm_command=CRM_COMMAND, property=option, value=json.dumps(value)) +return __salt__['cmd.retcode'](cmd) + + +def configure_op_defaults( +option, +value):
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-05-15 23:52:41 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.2738 (New) Package is "salt-shaptools" Fri May 15 23:52:41 2020 rev:13 rq:805831 version:0.3.4 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-03-08 22:21:29.143979291 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.2738/salt-shaptools.changes 2020-05-15 23:52:44.657593591 +0200 @@ -1,0 +2,20 @@ +Fri Mar 27 18:06:32 UTC 2020 - Simranpal Singh + +- Version 0.3.4 + * Add new salt module and state to extract the sar files using SAPCAR + +--- +Fri Mar 20 14:49:04 UTC 2020 - Xabier Arbulu + +- Version 0.3.3 + * Add new salt state to extract the HANA python dbapi client + +--- +Thu Mar 5 10:03:39 UTC 2020 - Xabier Arbulu + +- Version 0.3.2 + * Add a new salt state method to update corosync configuration +file + * Fix travis file to install the py packages in develop mode + +--- Old: salt-shaptools-0.3.1.tar.gz New: salt-shaptools-0.3.4.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.aFKARX/_old 2020-05-15 23:52:45.757595711 +0200 +++ /var/tmp/diff_new_pack.aFKARX/_new 2020-05-15 23:52:45.761595719 +0200 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.1 +Version:0.3.4 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management @@ -51,7 +51,8 @@ cp -R salt/states/netweavermod.py %{buildroot}/srv/salt/_states cp -R salt/modules/saptunemod.py %{buildroot}/srv/salt/_modules cp -R salt/states/saptunemod.py %{buildroot}/srv/salt/_states - +cp -R salt/modules/sapcarmod.py %{buildroot}/srv/salt/_modules +cp -R salt/states/sapcarmod.py %{buildroot}/srv/salt/_states %files %defattr(-,root,root,-) ++ salt-shaptools-0.3.1.tar.gz -> salt-shaptools-0.3.4.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.1/salt/modules/hanamod.py new/salt-shaptools-0.3.4/salt/modules/hanamod.py --- old/salt-shaptools-0.3.1/salt/modules/hanamod.py2020-03-06 15:03:43.200091220 +0100 +++ new/salt-shaptools-0.3.4/salt/modules/hanamod.py2020-03-31 20:02:39.980481668 +0200 @@ -22,9 +22,19 @@ # Import Python libs from __future__ import absolute_import, unicode_literals, print_function + +import logging import time +import re + +try: # pragma: no cover +import importlib as imp +except ImportError: # pragma: no cover +import imp from salt import exceptions +from salt.utils import files as salt_files + # Import third party libs try: @@ -35,8 +45,19 @@ except ImportError: # pragma: no cover HAS_HANA = False +LOGGER = logging.getLogger(__name__) + __virtualname__ = 'hana' +LABEL_FILE = 'LABEL.ASC' +LABELIDX_FILE = 'LABELIDX.ASC' + + +class SapFolderNotFoundError(Exception): +''' +SAP folder not found exception +''' + def __virtual__(): # pragma: no cover ''' @@ -865,17 +886,17 @@ ''' Wait until HANA is ready trying to connect to the database -host: +host Host where HANA is running -port: +port HANA database port -user: +user User to connect to the databse -password: +password Password to connect to the database -timeout: +timeout Timeout to try to connect to the database -interval: +interval Interval to try the connection CLI Example: @@ -900,4 +921,75 @@ raise exceptions.CommandExecutionError( 'HANA database not available after {} seconds in {}:{}'.format( timeout, host, port -)) \ No newline at end of file +)) + + +def reload_hdb_connector(): +''' +As hdb_connector uses pyhdb or dbapi, if these packages are installed on the fly, +we need to reload the connector to import the correct api +''' +imp.reload(hdb_connector) + + +def _find_sap_folder(software_folders, folder_pattern): +''' +Find a SAP folder following a recursive approach using the LABEL and LABELIDX files +''' +for folder in software_folders: +label = '{}/{}'.format(folder, LABEL_FILE) +try: +with salt_files.fopen(label, 'r') as label_file_ptr: +
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-03-08 22:21:22 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.26092 (New) Package is "salt-shaptools" Sun Mar 8 22:21:22 2020 rev:12 rq:782130 version:0.3.1 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-01-29 13:18:33.738175412 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.26092/salt-shaptools.changes 2020-03-08 22:21:29.143979291 +0100 @@ -5,0 +6 @@ + (jsc#SLE-4031, jsc#SLE-4143, boo#1137989) Other differences: -- ++ salt-shaptools-0.3.1.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.1/salt-shaptools.changes new/salt-shaptools-0.3.1/salt-shaptools.changes --- old/salt-shaptools-0.3.1/salt-shaptools.changes 2020-01-27 08:16:57.504733184 +0100 +++ new/salt-shaptools-0.3.1/salt-shaptools.changes 2020-03-06 15:03:43.200091220 +0100 @@ -2,19 +2,20 @@ Fri Jan 24 10:40:26 UTC 2020 - Xabier Arbulu - Version 0.3.1 - * Add the virtual_host_mask parameter (gcp uses 32 mask) + * Add the virtual_host_mask parameter (gcp uses 32 mask) + (jsc#SLE-4031, jsc#SLE-4143, boo#1137989) --- Wed Jan 22 10:52:20 UTC 2020 - Dario Maiocchi - Version 0.3.0 - * Add first version of saptune module to apply specific solution + * Add first version of saptune module to apply specific solution --- Thu Jan 9 15:28:29 UTC 2020 - Simranpal Singh - Version 0.2.12 - * Add module fn to update nw installation conf files + * Add module fn to update nw installation conf files --- Wed Jan 8 16:45:18 UTC 2020 - Simranpal Singh @@ -26,7 +27,7 @@ Wed Jan 08 10:16:53 UTC 2020 - Xabier Arbulu - Version 0.2.10 - Add crmsh --no-overwrite-sshkeys option + Add crmsh --no-overwrite-sshkeys option --- Mon Dec 23 07:39:31 UTC 2019 - nick wang @@ -45,7 +46,7 @@ Mon Dec 16 09:31:18 UTC 2019 - Xabier Arbulu - Version 0.2.7 - * Add automatic cloud detection method to the salt module + * Add automatic cloud detection method to the salt module --- Wed Dec 11 10:16:53 UTC 2019 - Xabier Arbulu
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-01-29 13:18:09 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.26092 (New) Package is "salt-shaptools" Wed Jan 29 13:18:09 2020 rev:11 rq:768022 version:0.3.1 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-01-25 13:24:52.104055178 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.26092/salt-shaptools.changes 2020-01-29 13:18:33.738175412 +0100 @@ -1,0 +2,6 @@ +Fri Jan 24 10:40:26 UTC 2020 - Xabier Arbulu + +- Version 0.3.1 + * Add the virtual_host_mask parameter (gcp uses 32 mask) + +--- Old: salt-shaptools-0.3.0.tar.gz New: salt-shaptools-0.3.1.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.YGhyw7/_old 2020-01-29 13:18:34.758175934 +0100 +++ /var/tmp/diff_new_pack.YGhyw7/_new 2020-01-29 13:18:34.758175934 +0100 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.3.0 +Version:0.3.1 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ salt-shaptools-0.3.0.tar.gz -> salt-shaptools-0.3.1.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.0/salt/__init__.py new/salt-shaptools-0.3.1/salt/__init__.py --- old/salt-shaptools-0.3.0/salt/__init__.py 2020-01-23 12:08:57.968470309 +0100 +++ new/salt-shaptools-0.3.1/salt/__init__.py 2020-01-27 08:16:57.504733184 +0100 @@ -6,4 +6,4 @@ :since: 2018-11-30 """ -__version__ = "0.2.11" +__version__ = "0.3.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.0/salt/modules/netweavermod.py new/salt-shaptools-0.3.1/salt/modules/netweavermod.py --- old/salt-shaptools-0.3.0/salt/modules/netweavermod.py 2020-01-23 12:08:57.968470309 +0100 +++ new/salt-shaptools-0.3.1/salt/modules/netweavermod.py 2020-01-27 08:16:57.504733184 +0100 @@ -229,14 +229,17 @@ def attach_virtual_host( virtual_host, -virtual_host_interface='eth0'): +virtual_host_interface='eth0', +virtual_host_mask=24): ''' Attach virtual host ip address to network interface virtual_host Virtual host name -virtual_host_interface: +virtual_host_interface Network interface to attach the virtual host ip address +virtual_host_mask +Ip address mask for the virtual address (24 be default) Returns: str: Attached ip address @@ -250,10 +253,11 @@ ip_address = __salt__['hosts.get_ip'](virtual_host) if not ip_address: raise exceptions.CommandExecutionError('virtual host {} not available'.format(virtual_host)) -result = __salt__['cmd.retcode']('ip a | grep {}/24'.format(ip_address), python_shell=True) +result = __salt__['cmd.retcode']( +'ip a | grep {}/{}'.format(ip_address, virtual_host_mask), python_shell=True) if result == 1: -result = __salt__['cmd.run']('ip address add {}/24 dev {}'.format( -ip_address, virtual_host_interface)) +result = __salt__['cmd.run']('ip address add {}/{} dev {}'.format( +ip_address, virtual_host_mask, virtual_host_interface)) # Non zero return code in any of the cmd commands if result: raise exceptions.CommandExecutionError('error running "ip address" command') @@ -270,10 +274,10 @@ Path to the existing configuration file extra_parameters (dict): Dictionary with the values to be updated. Use the exact name of the SAP configuration file for the key - + Returns: str: Configuration file path - + CLI Example: .. code-block:: bash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.3.0/salt/states/netweavermod.py new/salt-shaptools-0.3.1/salt/states/netweavermod.py --- old/salt-shaptools-0.3.0/salt/states/netweavermod.py2020-01-23 12:08:57.968470309 +0100 +++ new/salt-shaptools-0.3.1/salt/states/netweavermod.py2020-01-27 08:16:57.504733184 +0100 @@ -74,6 +74,7 @@ cwd='/tmp/swpm_unattended', additional_dvds=None, ascs_password=None, +virtual_host_mask=24, timeout=0, interval=5): """ @@ -109,6 +110,8 @@ ascs_password (Only used when the Product is ERS.) Password of the SAP user in
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-01-25 13:24:46 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.26092 (New) Package is "salt-shaptools" Sat Jan 25 13:24:46 2020 rev:10 rq:766938 version:0.3.0 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2020-01-10 17:51:46.578134140 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.26092/salt-shaptools.changes 2020-01-25 13:24:52.104055178 +0100 @@ -1,0 +2,6 @@ +Wed Jan 22 10:52:20 UTC 2020 - Dario Maiocchi + +- Version 0.3.0 + * Add first version of saptune module to apply specific solution + +--- Old: salt-shaptools-0.2.12.tar.gz New: salt-shaptools-0.3.0.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.PwcBnI/_old 2020-01-25 13:24:53.860055948 +0100 +++ /var/tmp/diff_new_pack.PwcBnI/_new 2020-01-25 13:24:53.892055962 +0100 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.12 +Version:0.3.0 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management @@ -49,6 +49,8 @@ cp -R salt/states/drbdmod.py %{buildroot}/srv/salt/_states cp -R salt/modules/netweavermod.py %{buildroot}/srv/salt/_modules cp -R salt/states/netweavermod.py %{buildroot}/srv/salt/_states +cp -R salt/modules/saptunemod.py %{buildroot}/srv/salt/_modules +cp -R salt/states/saptunemod.py %{buildroot}/srv/salt/_states %files ++ salt-shaptools-0.2.12.tar.gz -> salt-shaptools-0.3.0.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.12/README.md new/salt-shaptools-0.3.0/README.md --- old/salt-shaptools-0.2.12/README.md 2020-01-09 16:37:15.619797345 +0100 +++ new/salt-shaptools-0.3.0/README.md 2020-01-23 12:08:57.968470309 +0100 @@ -23,7 +23,7 @@ To run the state modules (there is a demo example in the demo folder) run: ```bash cd salt-shaptools -sudo salt-call --local --retcode-passthrough -l debug -m . state.template demo/primary.sls +sudo salt-call --retcode-passthrough -l debug -m . state.template demo/primary.sls ``` ### Run in minions @@ -33,12 +33,15 @@ 2. Copy the content of **states** in your "salt://_states/" (by default /srv/salt/_states) 3. Synchronize modules with the minions. For that run: ```bash -sudo salt '*' saltutil.sync_states +sudo salt-call saltutil.sync_all ``` 4. Execute the module functionalities. For that run: ```bash sudo salt-call hana.is_installed ``` +## Writing unit test + +You can have look at: https://docs.saltstack.com/en/latest/topics/development/tests/unit.html ## How to run the tests Salt has a quite particular way to execute the tests. As a summary, tests are splitted @@ -51,17 +54,29 @@ is in a separated repository, the easiest way is to copy our project code to a actual salt repository and run the tests. For that follow the next instructions: -1. Download the salt project in the same folder of this project: +1. Download 2 **needed extra projects**: (saltstack and shaptools) + ```bash -git clone g...@github.com:saltstack/salt.git +git clone --depth=50 https://github.com/openSUSE/salt +git clone https://github.com/SUSE/shaptools.git +``` + +Your directory layout should looks like ( all the 3 dirs are in same three dir level) +``` +- salt-shaptools +- salt +- shaptools ``` -2. Create a virtual environment (python2 must be used here) and install dependencies: + + +2. Create a virtual environment, inside the `salt-shaptools` dir and install dependencies: ```bash virtualenv saltvirtenv source saltvirtenv/bin/activate -pip install pyzmq PyYAML pycrypto msgpack-python jinja2 psutil futures tornado pytest-salt mock -pip install -e salt -pip install -e shaptools #put the correct path +pip install pyzmq PyYAML pycrypto msgpack-python jinja2 psutil futures tornado pytest-salt mock pytest-cov +pip install -e ../salt +pip install -e ../shaptools +rm ../salt/tests/conftest.py # remove this file from the saltstack repo ``` 3. Run the tests. For that: @@ -71,6 +86,21 @@ ./tests/run.sh ``` +4) Running your modules/states: + +For testing/running modules: + +``` +salt-call --local saptune.apply_solution "SAP-ASE" + +``` + +For testing/running states: +``` +salt-call --local state.single saptune.solution_applied "HANA" +``` + + ## Dependencies List of dependencies are specified in the ["Requirements file"](requirements.txt). Items can be
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2020-01-10 17:51:42 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.6675 (New) Package is "salt-shaptools" Fri Jan 10 17:51:42 2020 rev:9 rq:762852 version:0.2.12 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-12-23 22:48:57.218101090 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.6675/salt-shaptools.changes 2020-01-10 17:51:46.578134140 +0100 @@ -1,0 +2,18 @@ +Thu Jan 9 15:28:29 UTC 2020 - Simranpal Singh + +- Version 0.2.12 + * Add module fn to update nw installation conf files + +--- +Wed Jan 8 16:45:18 UTC 2020 - Simranpal Singh + +- Version 0.2.11 + * Add functionality to install hana with xml passwords file + +--- +Wed Jan 08 10:16:53 UTC 2020 - Xabier Arbulu + +- Version 0.2.10 + Add crmsh --no-overwrite-sshkeys option + +--- Old: salt-shaptools-0.2.9.tar.gz New: salt-shaptools-0.2.12.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.MZ0Ik3/_old 2020-01-10 17:51:47.342134524 +0100 +++ /var/tmp/diff_new_pack.MZ0Ik3/_new 2020-01-10 17:51:47.342134524 +0100 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.9 +Version:0.2.12 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ salt-shaptools-0.2.9.tar.gz -> salt-shaptools-0.2.12.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.9/salt/__init__.py new/salt-shaptools-0.2.12/salt/__init__.py --- old/salt-shaptools-0.2.9/salt/__init__.py 2019-12-23 09:51:40.024493544 +0100 +++ new/salt-shaptools-0.2.12/salt/__init__.py 2020-01-09 16:37:15.619797345 +0100 @@ -6,4 +6,4 @@ :since: 2018-11-30 """ -__version__ = "0.2.7" +__version__ = "0.2.11" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.9/salt/modules/crmshmod.py new/salt-shaptools-0.2.12/salt/modules/crmshmod.py --- old/salt-shaptools-0.2.9/salt/modules/crmshmod.py 2019-12-23 09:51:40.024493544 +0100 +++ new/salt-shaptools-0.2.12/salt/modules/crmshmod.py 2020-01-09 16:37:15.619797345 +0100 @@ -288,6 +288,7 @@ admin_ip=None, sbd=None, sbd_dev=None, +no_overwrite_sshkey=False, quiet=None): ''' crm cluster init command execution @@ -307,6 +308,8 @@ if sbd_dev: sbd_str = ' '.join(['-s {}'.format(sbd) for sbd in sbd_dev]) cmd = '{cmd} {sbd_str}'.format(cmd=cmd, sbd_str=sbd_str) +if no_overwrite_sshkey: +cmd = '{cmd} --no-overwrite-sshkey'.format(cmd=cmd) if quiet: cmd = '{cmd} -q'.format(cmd=cmd) @@ -395,6 +398,7 @@ admin_ip=None, sbd=None, sbd_dev=None, +no_overwrite_sshkey=False, quiet=None): ''' Initialize a cluster from scratch. @@ -416,6 +420,9 @@ sbd_dev sbd device path. To be used "sbd" parameter must be used too. If None, the sbd is set as diskless. +no_overwrite_sshkey +No overwrite the currently existing sshkey (/root/.ssh/id_rsa) +Only available after crmsh 3.0.0 quiet: execute the command in quiet mode (no output) @@ -432,9 +439,11 @@ # and create the corresponing UT if __salt__['crm.use_crm']: return _crm_init( -name, watchdog, interface, unicast, admin_ip, sbd, sbd_dev, quiet) +name, watchdog, interface, unicast, admin_ip, sbd, sbd_dev, no_overwrite_sshkey, quiet) LOGGER.warning('The parameter name is not considered!') +LOGGER.warning('--no_overwrite_sshkey option not available') + return _ha_cluster_init( watchdog, interface, unicast, admin_ip, sbd, sbd_dev, quiet) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.9/salt/modules/hanamod.py new/salt-shaptools-0.2.12/salt/modules/hanamod.py --- old/salt-shaptools-0.2.9/salt/modules/hanamod.py2019-12-23 09:51:40.024493544 +0100 +++ new/salt-shaptools-0.2.12/salt/modules/hanamod.py 2020-01-09 16:37:15.619797345 +0100 @@ -162,12 +162,37 @@ except IOError as err: raise exceptions.CommandExecutionError(err) +def
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2019-12-23 22:45:58 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.6675 (New) Package is "salt-shaptools" Mon Dec 23 22:45:58 2019 rev:8 rq:758957 version:0.2.9 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-12-21 12:33:01.251410015 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.6675/salt-shaptools.changes 2019-12-23 22:48:57.218101090 +0100 @@ -1,0 +2,13 @@ +Mon Dec 23 07:39:31 UTC 2019 - nick wang + +- Version 0.2.9 + * DRBD: refactory check_sync_status to avoid call drbdsetup +multiple times + +--- +Fri Dec 20 09:12:51 UTC 2019 - nick wang + +- Version 0.2.8 + * DRBD: check unfinished request in sync status via json + +--- Old: salt-shaptools-0.2.7.tar.gz New: salt-shaptools-0.2.9.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.MImIiV/_old 2019-12-23 22:48:57.702101268 +0100 +++ /var/tmp/diff_new_pack.MImIiV/_new 2019-12-23 22:48:57.702101268 +0100 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.7 +Version:0.2.9 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ salt-shaptools-0.2.7.tar.gz -> salt-shaptools-0.2.9.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.7/salt/modules/drbdmod.py new/salt-shaptools-0.2.9/salt/modules/drbdmod.py --- old/salt-shaptools-0.2.7/salt/modules/drbdmod.py2019-12-19 13:09:10.379511814 +0100 +++ new/salt-shaptools-0.2.9/salt/modules/drbdmod.py2019-12-23 09:51:40.024493544 +0100 @@ -223,48 +223,29 @@ func(line) -def _is_local_all_uptodated(name): +def _is_local_all_uptodated(res, output): ''' -Check whether all local volumes are UpToDate. +Check whether all local volumes of given resource are UpToDate. ''' -if __salt__['drbd.json']: -output = OUTPUT_OPTIONS['json'] -else: -output = OUTPUT_OPTIONS['text'] - -res = output["get_res_func"](name) -if not res: -return False - -# Since name is not all, res only have one element -for vol in res[0][output["volume"]]: +for vol in res[output["volume"]]: if vol[output["state"]] != 'UpToDate': return False return True -def _is_peers_uptodated(name, peernode='all'): +def _is_peers_uptodated(res, output, peernode='all'): ''' -Check whether all volumes of peer node are UpToDate. +Check whether all volumes of peer node of given resource are UpToDate. .. note:: If peernode is not match, will return None, same as False. ''' -if __salt__['drbd.json']: -output = OUTPUT_OPTIONS['json'] -else: -output = OUTPUT_OPTIONS['text'] - -res = output["get_res_func"](name) - -if not res: -return False +ret = False -# Since name is not all, res only have one element -for node in res[0][output["connection"]]: +for node in res[output["connection"]]: if peernode != 'all' and node[output["peer_node"]] != peernode: continue @@ -278,6 +259,27 @@ return ret +def _is_no_backing_dev_request(res, output): +''' +Check whether all volumes have no unfinished backing device request. +Only working when json status supported. + +Metadata still need to sync to disk after state changed. +Only reply to sync target to change when I/O request finished, +which is unpredictable. Local refernece count is not 0 before endio. + +''' +if not __salt__['drbd.json']: +return True + +# Since name is not all, res only have one element +for vol in res[output["volume"]]: +if int(vol[output["local_cnt"]]) != 0: +return False + +return True + + def overview(): ''' Show status of the DRBD devices, support two nodes only. @@ -657,6 +659,7 @@ "peer_node": "name", "peer_node_vol": "peer_devices", "peer_node_state": "peer-disk-state", +"local_cnt": "lower-pending", "get_res_func": setup_status }, "text": { @@ -689,8 +692,22 @@ salt '*' drbd.check_sync_status ''' -if _is_local_all_uptodated(name) and _is_peers_uptodated( -name, peernode=peernode): +if __salt__['drbd.json']: +output =
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2019-12-21 12:32:32 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.6675 (New) Package is "salt-shaptools" Sat Dec 21 12:32:32 2019 rev:7 rq:758455 version:0.2.7 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-12-16 15:20:48.487128181 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.6675/salt-shaptools.changes 2019-12-21 12:33:01.251410015 +0100 @@ -1,0 +2,6 @@ +Mon Dec 16 09:31:18 UTC 2019 - Xabier Arbulu + +- Version 0.2.7 + * Add automatic cloud detection method to the salt module + +--- Old: salt-shaptools-0.2.6.tar.gz New: salt-shaptools-0.2.7.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.VRzNeU/_old 2019-12-21 12:33:02.923410810 +0100 +++ /var/tmp/diff_new_pack.VRzNeU/_new 2019-12-21 12:33:02.927410811 +0100 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.6 +Version:0.2.7 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ salt-shaptools-0.2.6.tar.gz -> salt-shaptools-0.2.7.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.6/salt/__init__.py new/salt-shaptools-0.2.7/salt/__init__.py --- old/salt-shaptools-0.2.6/salt/__init__.py 2019-12-16 09:03:42.874852476 +0100 +++ new/salt-shaptools-0.2.7/salt/__init__.py 2019-12-19 13:09:10.379511814 +0100 @@ -6,4 +6,4 @@ :since: 2018-11-30 """ -__version__ = "0.2.6" +__version__ = "0.2.7" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.6/salt/modules/crmshmod.py new/salt-shaptools-0.2.7/salt/modules/crmshmod.py --- old/salt-shaptools-0.2.6/salt/modules/crmshmod.py 2019-12-16 09:03:42.878852476 +0100 +++ new/salt-shaptools-0.2.7/salt/modules/crmshmod.py 2019-12-19 13:09:10.379511814 +0100 @@ -63,7 +63,8 @@ 'The crmsh execution module failed to load: the ha-cluster-init' ' package is not available.') -__salt__['crm.version'] = use_crm +__salt__['crm.version'] = version +__salt__['crm.use_crm'] = use_crm return __virtualname__ @@ -429,7 +430,7 @@ # INFO: 2 different methods are created to make easy to read/understand # and create the corresponing UT -if __salt__['crm.version']: +if __salt__['crm.use_crm']: return _crm_init( name, watchdog, interface, unicast, admin_ip, sbd, sbd_dev, quiet) @@ -515,7 +516,7 @@ ''' # INFO: 2 different methods are created to make easy to read/understand # and create the corresponing UT -if __salt__['crm.version']: +if __salt__['crm.use_crm']: return _crm_join(host, watchdog, interface, quiet) return _ha_cluster_join(host, watchdog, interface, quiet) @@ -582,3 +583,32 @@ method=method, url=url) return __salt__['cmd.retcode'](cmd) + + +def detect_cloud(): +''' +Detect if crmsh is being executed in some cloud provider + +INFO: The code is implemented this way because crmsh is still using python2 in +SLE12SP3 and python3 beyond, but salt is running python2 until SLE15, so SLE12SP4 breaks +the rule. + +Otherwise we could just use: +from crmsh import utils +return utils.detect_cloud() + +These are the currently known platforms: +* amazon-web-services +* microsoft-azure +* google-cloud-platform +* None (as string)(otherwise) +''' +if int(__salt__['crm.version'][0]) <= 3: +version = 'python' +else: +version = 'python3' + +cmd = '{version} -c "from crmsh import utils; print(utils.detect_cloud());"'.format( +version=version) +provider = __salt__['cmd.run'](cmd).strip() +return provider diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.6/salt-shaptools.changes new/salt-shaptools-0.2.7/salt-shaptools.changes --- old/salt-shaptools-0.2.6/salt-shaptools.changes 2019-12-16 09:03:42.878852476 +0100 +++ new/salt-shaptools-0.2.7/salt-shaptools.changes 2019-12-19 13:09:10.379511814 +0100 @@ -1,4 +1,10 @@ --- +Mon Dec 16 09:31:18 UTC 2019 - Xabier Arbulu + +- Version 0.2.7 + * Add automatic cloud detection method to the salt module +
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2019-12-16 15:20:47 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.4691 (New) Package is "salt-shaptools" Mon Dec 16 15:20:47 2019 rev:6 rq:757272 version:0.2.6 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-12-09 21:36:05.962077454 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.4691/salt-shaptools.changes 2019-12-16 15:20:48.487128181 +0100 @@ -1,0 +2,6 @@ +Wed Dec 11 10:16:53 UTC 2019 - Xabier Arbulu + +- Version 0.2.6 + * Add option to configure multiple sbd disks + +--- Old: salt-shaptools-0.2.5.tar.gz New: salt-shaptools-0.2.6.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.7bWYX2/_old 2019-12-16 15:20:48.895128011 +0100 +++ /var/tmp/diff_new_pack.7bWYX2/_new 2019-12-16 15:20:48.903128008 +0100 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.5 +Version:0.2.6 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ salt-shaptools-0.2.5.tar.gz -> salt-shaptools-0.2.6.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.5/salt/__init__.py new/salt-shaptools-0.2.6/salt/__init__.py --- old/salt-shaptools-0.2.5/salt/__init__.py 2019-12-09 03:44:43.029007691 +0100 +++ new/salt-shaptools-0.2.6/salt/__init__.py 2019-12-16 09:03:42.874852476 +0100 @@ -6,4 +6,4 @@ :since: 2018-11-30 """ -__version__ = "0.2.1" +__version__ = "0.2.6" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.5/salt/modules/crmshmod.py new/salt-shaptools-0.2.6/salt/modules/crmshmod.py --- old/salt-shaptools-0.2.5/salt/modules/crmshmod.py 2019-12-09 03:44:43.029007691 +0100 +++ new/salt-shaptools-0.2.6/salt/modules/crmshmod.py 2019-12-16 09:03:42.878852476 +0100 @@ -304,7 +304,8 @@ if sbd: cmd = '{cmd} --enable-sbd'.format(cmd=cmd) if sbd_dev: -cmd = '{cmd} -s {sbd_dev}'.format(cmd=cmd, sbd_dev=sbd_dev) +sbd_str = ' '.join(['-s {}'.format(sbd) for sbd in sbd_dev]) +cmd = '{cmd} {sbd_str}'.format(cmd=cmd, sbd_str=sbd_str) if quiet: cmd = '{cmd} -q'.format(cmd=cmd) @@ -334,7 +335,8 @@ if sbd: cmd = '{cmd} -S'.format(cmd=cmd) if sbd_dev: -cmd = '{cmd} -s {sbd_dev}'.format(cmd=cmd, sbd_dev=sbd_dev) +sbd_str = ' '.join(['-s {}'.format(sbd) for sbd in sbd_dev]) +cmd = '{cmd} {sbd_str}'.format(cmd=cmd, sbd_str=sbd_str) if quiet: cmd = '{cmd} -q'.format(cmd=cmd) @@ -346,6 +348,44 @@ return return_code +def _manage_multiple_sbd(sbd_enabled, sbd_dev): +''' +crmsh doesn't support multiple sbd disk usage by now. This method workaround this scenario +modifying the /etc/syconfig/sbd file before running crmsh +''' +# sbd disks are managed as list, but individual disk is accepted to be more compatible +if sbd_dev and not isinstance(sbd_dev, list): +sbd_dev = [sbd_dev] + +# return sbd_dev + +if not sbd_enabled or not sbd_dev or len(sbd_dev) == 1: +return sbd_enabled, sbd_dev + +LOGGER.warning('crmsh will say that sbd is not configured') + +sbd_str = ' '.join(['-d {}'.format(sbd) for sbd in sbd_dev]) +cmd = 'sbd {disks} create'.format(disks=sbd_str) +return_code = __salt__['cmd.retcode'](cmd) +if return_code: +raise exceptions.SaltInvocationError('sbd disks could not be formatted properly') + +cmd = '{crm_command} cluster init sbd -s {sbd}'.format(crm_command=CRM_COMMAND, sbd=sbd_dev[0]) +return_code = __salt__['cmd.retcode'](cmd) +if return_code: +raise exceptions.SaltInvocationError('crm cluster init sbd failed') + +__salt__['file.replace']( +path='/etc/sysconfig/sbd', +pattern='^SBD_DEVICE=.*', +repl='SBD_DEVICE={}'.format(';'.join(sbd_dev)), +append_if_not_found=True +) + +# return None, None to avoid sbd configuration in crmsh +return None, None + + def cluster_init( name, watchdog=None, @@ -384,13 +424,16 @@ salt '*' crm.cluster_init hacluster ''' +# Workaournd while multiple sbd disks are not supported by crmsh +sbd, sbd_dev = _manage_multiple_sbd(sbd, sbd_dev) + # INFO: 2 different methods
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2019-12-09 21:35:49 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.4691 (New) Package is "salt-shaptools" Mon Dec 9 21:35:49 2019 rev:5 rq:755180 version:0.2.5 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-11-22 10:27:44.909232429 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.4691/salt-shaptools.changes 2019-12-09 21:36:05.962077454 +0100 @@ -1,0 +2,11 @@ +Tue Dec 3 06:41:36 UTC 2019 - nick wang + +- Version 0.2.5 + DRBD: support to get status via json format by default. + +--- +Thu Nov 21 09:05:07 UTC 2019 - nick wang + +- Version 0.2.4, fix error parsing drbd status when congested. + +--- Old: salt-shaptools-0.2.3.tar.gz New: salt-shaptools-0.2.5.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.jAkuvr/_old 2019-12-09 21:36:07.366076901 +0100 +++ /var/tmp/diff_new_pack.jAkuvr/_new 2019-12-09 21:36:07.366076901 +0100 @@ -19,7 +19,7 @@ # See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.3 +Version:0.2.5 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management ++ salt-shaptools-0.2.3.tar.gz -> salt-shaptools-0.2.5.tar.gz ++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.3/salt/modules/crmshmod.py new/salt-shaptools-0.2.5/salt/modules/crmshmod.py --- old/salt-shaptools-0.2.3/salt/modules/crmshmod.py 2019-11-06 09:36:32.167389490 +0100 +++ new/salt-shaptools-0.2.5/salt/modules/crmshmod.py 2019-12-09 03:44:43.029007691 +0100 @@ -50,9 +50,6 @@ version = __salt__['pkg.version'](CRMSH) use_crm = __salt__['pkg.version_cmp']( version, CRM_NEW_VERSION) >= 0 -LOGGER.info('crmsh version: %s', version) -LOGGER.info( -'%s will be used', 'crm' if use_crm else 'ha-cluster') else: return ( @@ -66,7 +63,7 @@ 'The crmsh execution module failed to load: the ha-cluster-init' ' package is not available.') -__salt__['crmsh.version'] = use_crm +__salt__['crm.version'] = use_crm return __virtualname__ @@ -389,7 +386,7 @@ ''' # INFO: 2 different methods are created to make easy to read/understand # and create the corresponing UT -if __salt__['crmsh.version']: +if __salt__['crm.version']: return _crm_init( name, watchdog, interface, unicast, admin_ip, sbd, sbd_dev, quiet) @@ -475,7 +472,7 @@ ''' # INFO: 2 different methods are created to make easy to read/understand # and create the corresponing UT -if __salt__['crmsh.version']: +if __salt__['crm.version']: return _crm_join(host, watchdog, interface, quiet) return _ha_cluster_join(host, watchdog, interface, quiet) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/salt-shaptools-0.2.3/salt/modules/drbdmod.py new/salt-shaptools-0.2.5/salt/modules/drbdmod.py --- old/salt-shaptools-0.2.3/salt/modules/drbdmod.py2019-11-06 09:36:32.167389490 +0100 +++ new/salt-shaptools-0.2.5/salt/modules/drbdmod.py2019-12-09 03:44:43.029007691 +0100 @@ -30,6 +30,12 @@ __virtualname__ = 'drbd' DRBD_COMMAND = 'drbdadm' +ERR_STR = 'UNKNOWN' +DUMMY_STR = 'IGNORED' +WITH_JSON = True +DRBDADM = 'drbd-utils' +# drbd-utils >= 9.0.0 for json status +DRBDADM_JSON_VERSION = '9.0.0' def __virtual__(): # pragma: no cover @@ -37,6 +43,14 @@ Only load this module if drbdadm(drbd-utils) is installed ''' if bool(salt.utils.path.which(DRBD_COMMAND)): +__salt__['drbd.json'] = WITH_JSON + +version = __salt__['pkg.version'](DRBDADM) +json_support = __salt__['pkg.version_cmp'](version, +DRBDADM_JSON_VERSION) >= 0 +if not json_support: +__salt__['drbd.json'] = False + return __virtualname__ return ( False, @@ -85,10 +99,12 @@ switch = { 0: 'RESOURCE', 2: {' disk:': 'LOCALDISK', ' role:': 'PEERNODE', ' connection:': 'PEERNODE'}, -4: {' peer-disk:': 'PEERDISK'} +4: {' peer-disk:': 'PEERDISK'}, +6: DUMMY_STR, +8: DUMMY_STR, } -ret = switch.get(spaces, 'UNKNOWN') +ret = switch.get(spaces, ERR_STR) # isinstance(ret, str)
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2019-11-22 10:27:42 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.26869 (New) Package is "salt-shaptools" Fri Nov 22 10:27:42 2019 rev:4 rq:750142 version:0.2.3 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-11-06 14:35:51.310656192 +0100 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.26869/salt-shaptools.changes 2019-11-22 10:27:44.909232429 +0100 @@ -1,0 +2,5 @@ +Mon Nov 5 08:48:50 UTC 2019 - nick wang + +- Create package version 0.2.3 with drbd files renamed. + +--- @@ -4 +9 @@ -- Create package version 0.2.1 updating how additional_dvds is used +- Create package version 0.2.2 updating how additional_dvds is used Old: salt-shaptools-0.2.2.tar.gz New: salt-shaptools-0.2.3.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.619ltJ/_old 2019-11-22 10:27:46.037232096 +0100 +++ /var/tmp/diff_new_pack.619ltJ/_new 2019-11-22 10:27:46.041232095 +0100 @@ -12,14 +12,14 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # -# See also http://en.opensuse.org/openSUSE:Specfile_guidelines +# See also https://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.2 +Version:0.2.3 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management @@ -45,8 +45,8 @@ cp -R salt/states/hanamod.py %{buildroot}/srv/salt/_states cp -R salt/modules/crmshmod.py %{buildroot}/srv/salt/_modules cp -R salt/states/crmshmod.py %{buildroot}/srv/salt/_states -cp -R salt/modules/drbd.py %{buildroot}/srv/salt/_modules -cp -R salt/states/drbd.py %{buildroot}/srv/salt/_states +cp -R salt/modules/drbdmod.py %{buildroot}/srv/salt/_modules +cp -R salt/states/drbdmod.py %{buildroot}/srv/salt/_states cp -R salt/modules/netweavermod.py %{buildroot}/srv/salt/_modules cp -R salt/states/netweavermod.py %{buildroot}/srv/salt/_states ++ salt-shaptools-0.2.2.tar.gz -> salt-shaptools-0.2.3.tar.gz ++ 5440 lines of diff (skipped)
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2019-11-06 14:35:47 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.2990 (New) Package is "salt-shaptools" Wed Nov 6 14:35:47 2019 rev:3 rq:745541 version:0.2.2 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-07-04 15:42:21.930026286 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.2990/salt-shaptools.changes 2019-11-06 14:35:51.310656192 +0100 @@ -1,0 +2,12 @@ +Thu Oct 31 14:58:19 UTC 2019 - Xabier Arbulu + +- Create package version 0.2.1 updating how additional_dvds is used + in netweavermod + +--- +Wed Aug 7 12:54:03 UTC 2019 - Xabier Arbulu Insausti + +- Create first salt modules and states to manage SAP Netweaver + * Install ASCS SAP instance in a idempotent way + +--- Old: salt-shaptools-0.2.1.tar.gz New: salt-shaptools-0.2.2.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.Fe7R1b/_old 2019-11-06 14:35:52.254657208 +0100 +++ /var/tmp/diff_new_pack.Fe7R1b/_new 2019-11-06 14:35:52.258657212 +0100 @@ -19,7 +19,7 @@ # See also http://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.2.1 +Version:0.2.2 Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management @@ -47,6 +47,8 @@ cp -R salt/states/crmshmod.py %{buildroot}/srv/salt/_states cp -R salt/modules/drbd.py %{buildroot}/srv/salt/_modules cp -R salt/states/drbd.py %{buildroot}/srv/salt/_states +cp -R salt/modules/netweavermod.py %{buildroot}/srv/salt/_modules +cp -R salt/states/netweavermod.py %{buildroot}/srv/salt/_states %files ++ salt-shaptools-0.2.1.tar.gz -> salt-shaptools-0.2.2.tar.gz ++ 2406 lines of diff (skipped)
commit salt-shaptools for openSUSE:Factory
Hello community, here is the log from the commit of package salt-shaptools for openSUSE:Factory checked in at 2019-07-04 15:42:19 Comparing /work/SRC/openSUSE:Factory/salt-shaptools (Old) and /work/SRC/openSUSE:Factory/.salt-shaptools.new.4615 (New) Package is "salt-shaptools" Thu Jul 4 15:42:19 2019 rev:2 rq:709434 version:0.2.1 Changes: --- /work/SRC/openSUSE:Factory/salt-shaptools/salt-shaptools.changes 2019-05-08 15:16:40.773017073 +0200 +++ /work/SRC/openSUSE:Factory/.salt-shaptools.new.4615/salt-shaptools.changes 2019-07-04 15:42:21.930026286 +0200 @@ -1,0 +2,22 @@ +Tue Jun 11 11:34:25 UTC 2019 - Xabier Arbulu Insausti + +- Create package version 0.2.1 with fixed spec files. Now the package + is available in all SLE12 and SLE15 versions + (jsc#SLE-4031, jsc#SLE-4143, boo#1137989) + +--- +Tue Jun 4 07:29:24 UTC 2019 - Xabier Arbulu Insausti + +- Create package version 0.2.0 after adding drbd module + +--- +Thu May 16 09:03:43 UTC 2019 - Xabier Arbulu Insausti + +- Update secondary registration methods to use the new parameters + +--- +Fri May 07 12:00:53 UTC 2019 - Nick Wang + +- Add salt module and state to manage DRDB resources + +--- Old: salt-shaptools-0.1.0.tar.gz New: salt-shaptools-0.2.1.tar.gz Other differences: -- ++ salt-shaptools.spec ++ --- /var/tmp/diff_new_pack.YkQdZb/_old 2019-07-04 15:42:22.722027236 +0200 +++ /var/tmp/diff_new_pack.YkQdZb/_new 2019-07-04 15:42:22.726027241 +0200 @@ -19,8 +19,8 @@ # See also http://en.opensuse.org/openSUSE:Specfile_guidelines Name: salt-shaptools -Version:0.1.0 -Release:1 +Version:0.2.1 +Release:0 Summary:Salt modules and states for SAP Applications and SLE-HA components management License:Apache-2.0 @@ -45,12 +45,18 @@ cp -R salt/states/hanamod.py %{buildroot}/srv/salt/_states cp -R salt/modules/crmshmod.py %{buildroot}/srv/salt/_modules cp -R salt/states/crmshmod.py %{buildroot}/srv/salt/_states +cp -R salt/modules/drbd.py %{buildroot}/srv/salt/_modules +cp -R salt/states/drbd.py %{buildroot}/srv/salt/_states %files %defattr(-,root,root,-) -%license LICENSE +%if 0%{?sle_version:1} && 0%{?sle_version} < 120300 +%doc README.md LICENSE +%else %doc README.md +%license LICENSE +%endif /srv/salt/_modules /srv/salt/_states ++ salt-shaptools-0.1.0.tar.gz -> salt-shaptools-0.2.1.tar.gz ++ 3591 lines of diff (skipped)