Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fence-agents for openSUSE:Factory 
checked in at 2023-05-01 18:51:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fence-agents (Old)
 and      /work/SRC/openSUSE:Factory/.fence-agents.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fence-agents"

Mon May  1 18:51:36 2023 rev:66 rq:1083859 
version:4.12.1+git.1682325255.86f77326

Changes:
--------
--- /work/SRC/openSUSE:Factory/fence-agents/fence-agents.changes        
2023-03-21 17:42:58.118243676 +0100
+++ /work/SRC/openSUSE:Factory/.fence-agents.new.1533/fence-agents.changes      
2023-05-01 18:51:37.601513880 +0200
@@ -1,0 +2,10 @@
+Mon May 01 12:23:24 UTC 2023 - [email protected]
+
+- Update to version 4.12.1+git.1682325255.86f77326:
+  * fence_aliyun: support filter for list-action
+  * fence_scsi: Automatically detect devices for shared VGs
+  * Adds earlyexit parameter to power_cycle_instance for fence_gce
+  * fence_aws: fail when power action request fails
+  * fence_aws: fixes to allow running outside of AWS network
+
+-------------------------------------------------------------------

Old:
----
  fence-agents-4.12.1+git.1677142927.bf55c675.tar.xz

New:
----
  fence-agents-4.12.1+git.1682325255.86f77326.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fence-agents.spec ++++++
--- /var/tmp/diff_new_pack.WUnOk4/_old  2023-05-01 18:51:39.073522618 +0200
+++ /var/tmp/diff_new_pack.WUnOk4/_new  2023-05-01 18:51:39.081522666 +0200
@@ -25,7 +25,7 @@
 Summary:        Fence Agents for High Availability
 License:        GPL-2.0-only AND LGPL-2.1-only
 Group:          Productivity/Clustering/HA
-Version:        4.12.1+git.1677142927.bf55c675
+Version:        4.12.1+git.1682325255.86f77326
 Release:        0
 URL:            https://github.com/ClusterLabs/fence-agents
 Source0:        %{name}-%{version}.tar.xz

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.WUnOk4/_old  2023-05-01 18:51:39.137522998 +0200
+++ /var/tmp/diff_new_pack.WUnOk4/_new  2023-05-01 18:51:39.141523023 +0200
@@ -3,6 +3,6 @@
             <param 
name="url">git://github.com/ClusterLabs/fence-agents.git</param>
           <param 
name="changesrevision">8d746be92f191aa289f13a3703031c122a5e6cf3</param></service><service
 name="tar_scm">
                 <param 
name="url">https://github.com/ClusterLabs/fence-agents</param>
-              <param 
name="changesrevision">9d0d0d013c7edae43a4ebc5f46bf2e7a4f127654</param></service></servicedata>
+              <param 
name="changesrevision">525789dcdcb1e89f8b3dd2438b2fc3b2277f5cfe</param></service></servicedata>
 (No newline at EOF)
 

++++++ fence-agents-4.12.1+git.1677142927.bf55c675.tar.xz -> 
fence-agents-4.12.1+git.1682325255.86f77326.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/aliyun/fence_aliyun.py 
new/fence-agents-4.12.1+git.1682325255.86f77326/agents/aliyun/fence_aliyun.py
--- 
old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/aliyun/fence_aliyun.py   
    2023-02-23 10:02:07.000000000 +0100
+++ 
new/fence-agents-4.12.1+git.1682325255.86f77326/agents/aliyun/fence_aliyun.py   
    2023-04-24 10:34:15.000000000 +0200
@@ -76,6 +76,14 @@
        result = {}
        request = DescribeInstancesRequest()
        request.set_PageSize(100)
+
+       if "--filter" in options:
+               filter_key = options["--filter"].split("=")[0].strip()
+               filter_value = options["--filter"].split("=")[1].strip()
+               params = request.get_query_params()
+               params[filter_key] = filter_value
+               request.set_query_params(params)
+
        response = _send_request(conn, request)
        if response is not None:
                instance_list = response.get('Instances').get('Instance')
@@ -137,17 +145,25 @@
        all_opt["ram_role"] = {
                "getopt": ":",
                "longopt": "ram-role",
-               "help": "--ram-role=[name]        Ram Role",
+               "help": "--ram-role=[name]              Ram Role",
                "shortdesc": "Ram Role.",
                "required": "0",
                "order": 5
        }
+       all_opt["filter"] = {
+               "getopt": ":",
+               "longopt": "filter",
+               "help": "--filter=[key=value]           Filter (e.g. 
InstanceIds=[\"i-XXYYZZAA1\",\"i-XXYYZZAA2\"]",
+               "shortdesc": "Filter for list-action.",
+               "required": "0",
+               "order": 6
+       }
 
 # Main agent method
 def main():
        conn = None
 
-       device_opt = ["port", "no_password", "region", "access_key", 
"secret_key", "ram_role"]
+       device_opt = ["port", "no_password", "region", "access_key", 
"secret_key", "ram_role", "filter"]
 
        atexit.register(atexit_handler)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/aws/fence_aws.py 
new/fence-agents-4.12.1+git.1682325255.86f77326/agents/aws/fence_aws.py
--- old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/aws/fence_aws.py     
2023-02-23 10:02:07.000000000 +0100
+++ new/fence-agents-4.12.1+git.1682325255.86f77326/agents/aws/fence_aws.py     
2023-04-24 10:34:15.000000000 +0200
@@ -16,13 +16,13 @@
 except ImportError:
        pass
 
-logger = logging.getLogger("fence_aws")
+logger = logging.getLogger()
 logger.propagate = False
 logger.setLevel(logging.INFO)
 logger.addHandler(SyslogLibHandler())
 logging.getLogger('botocore.vendored').propagate = False
 
-def get_instance_id():
+def get_instance_id(options):
        try:
                token = requests.put('http://169.254.169.254/latest/api/token', 
headers={"X-aws-ec2-metadata-token-ttl-seconds" : 
"21600"}).content.decode("UTF-8")
                r = 
requests.get('http://169.254.169.254/latest/meta-data/instance-id', 
headers={"X-aws-ec2-metadata-token" : token}).content.decode("UTF-8")
@@ -30,12 +30,15 @@
        except HTTPError as http_err:
                logger.error('HTTP error occurred while trying to access EC2 
metadata server: %s', http_err)
        except Exception as err:
-               logger.error('A fatal error occurred while trying to access EC2 
metadata server: %s', err)
+               if "--skip-race-check" not in options:
+                       logger.error('A fatal error occurred while trying to 
access EC2 metadata server: %s', err)
+               else:
+                       logger.debug('A fatal error occurred while trying to 
access EC2 metadata server: %s', err)
        return None
-       
+
 
 def get_nodes_list(conn, options):
-       logger.info("Starting monitor operation")
+       logger.debug("Starting monitor operation")
        result = {}
        try:
                if "--filter" in options:
@@ -63,7 +66,7 @@
        try:
                instance = conn.instances.filter(Filters=[{"Name": 
"instance-id", "Values": [options["--plug"]]}])
                state = list(instance)[0].state["Name"]
-               logger.info("Status operation for EC2 instance %s returned 
state: %s",options["--plug"],state.upper())
+               logger.debug("Status operation for EC2 instance %s returned 
state: %s",options["--plug"],state.upper())
                if state == "running":
                        return "on"
                elif state == "stopped":
@@ -78,7 +81,7 @@
        except IndexError:
                fail(EC_STATUS)
        except Exception as e:
-               logging.error("Failed to get power status: %s", e)
+               logger.error("Failed to get power status: %s", e)
                fail(EC_STATUS)
 
 def get_self_power_status(conn, instance_id):
@@ -86,10 +89,10 @@
                instance = conn.instances.filter(Filters=[{"Name": 
"instance-id", "Values": [instance_id]}])
                state = list(instance)[0].state["Name"]
                if state == "running":
-                       logging.debug("Captured my (%s) state and it %s - 
returning OK - Proceeding with fencing",instance_id,state.upper())
+                       logger.debug("Captured my (%s) state and it %s - 
returning OK - Proceeding with fencing",instance_id,state.upper())
                        return "ok"
                else:
-                       logging.debug("Captured my (%s) state it is %s - 
returning Alert - Unable to fence other nodes",instance_id,state.upper())
+                       logger.debug("Captured my (%s) state it is %s - 
returning Alert - Unable to fence other nodes",instance_id,state.upper())
                        return "alert"
        
        except ClientError:
@@ -100,19 +103,20 @@
                return "fail"
 
 def set_power_status(conn, options):
-       my_instance = get_instance_id()
+       my_instance = get_instance_id(options)
        try:
                if (options["--action"]=="off"):
-                       if (get_self_power_status(conn,my_instance) == "ok"):
+                       if "--skip-race-check" in options or 
get_self_power_status(conn,my_instance) == "ok":
                                
conn.instances.filter(InstanceIds=[options["--plug"]]).stop(Force=True)
-                               logger.info("Called StopInstance API call for 
%s", options["--plug"])
+                               logger.debug("Called StopInstance API call for 
%s", options["--plug"])
                        else:
-                               logger.info("Skipping fencing as instance is 
not in running status")
+                               logger.debug("Skipping fencing as instance is 
not in running status")
                elif (options["--action"]=="on"):
                        
conn.instances.filter(InstanceIds=[options["--plug"]]).start()
        except Exception as e:
-               logger.error("Failed to power %s %s: %s", \
+               logger.debug("Failed to power %s %s: %s", \
                                options["--action"], options["--plug"], e)
+               fail(EC_STATUS)
 
 def define_new_opts():
        all_opt["region"] = {
@@ -156,12 +160,20 @@
                "default": "False",
                "order": 6
        }
+       all_opt["skip_race_check"] = {
+               "getopt" : "",
+               "longopt" : "skip-race-check",
+               "help" : "--skip-race-check              Skip race condition 
check",
+               "shortdesc": "Skip race condition check",
+               "required": "0",
+               "order": 7
+       }
 
 # Main agent method
 def main():
        conn = None
 
-       device_opt = ["port", "no_password", "region", "access_key", 
"secret_key", "filter", "boto3_debug"]
+       device_opt = ["port", "no_password", "region", "access_key", 
"secret_key", "filter", "boto3_debug", "skip_race_check"]
 
        atexit.register(atexit_handler)
 
@@ -183,12 +195,15 @@
 
        run_delay(options)
 
-       if options.get("--verbose") is not None:
-               lh = logging.FileHandler('/var/log/fence_aws_debug.log')
+       if "--debug-file" in options:
+               for handler in logger.handlers:
+                       if isinstance(handler, logging.FileHandler):
+                               logger.removeHandler(handler)
+               lh = logging.FileHandler(options["--debug-file"])
                logger.addHandler(lh)
                lhf = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s 
- %(message)s')
                lh.setFormatter(lhf)
-               logger.setLevel(logging.DEBUG)
+               lh.setLevel(logging.DEBUG)
        
        if options["--boto3_debug"].lower() not in ["1", "yes", "on", "true"]:
                boto3.set_stream_logger('boto3',logging.INFO)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/gce/fence_gce.py 
new/fence-agents-4.12.1+git.1682325255.86f77326/agents/gce/fence_gce.py
--- old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/gce/fence_gce.py     
2023-02-23 10:02:07.000000000 +0100
+++ new/fence-agents-4.12.1+git.1682325255.86f77326/agents/gce/fence_gce.py     
2023-04-24 10:34:15.000000000 +0200
@@ -304,6 +304,9 @@
                        operation = retry_api_execute(
                                        options,
                                        conn.instances().reset(project=project, 
zone=zone, instance=instance))
+                       if operation and "--earlyexit" in options:
+                               logging.info("Reset command sent, returning 
early and not waiting for the operation to complete")
+                               return True
                logging.info("Reset command sent, waiting for the operation to 
complete")
                if wait_for_operation(conn, options, zone, operation):
                        logging.info("Reset of %s in zone %s complete", 
instance, zone)
@@ -454,8 +457,8 @@
        all_opt["earlyexit"] = {
                "getopt" : "",
                "longopt" : "earlyexit",
-               "help" : "--earlyexit                    Return early if reset 
is already in progress",
-               "shortdesc" : "If an existing reset operation is detected, the 
fence agent will return before the operation completes with a 0 return code.",
+               "help" : "--earlyexit                    Return early from 
set_power_status if reset is already in progress, if power_cycle then do not 
wait for the reset",
+               "shortdesc" : "If running set_power_status and existing reset 
operation is detected or runnning power_cycle, the fence agent will return 
before the operation completes with a 0 return code.",
                "required" : "0",
                "order" : 13
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/scsi/fence_scsi.py 
new/fence-agents-4.12.1+git.1682325255.86f77326/agents/scsi/fence_scsi.py
--- old/fence-agents-4.12.1+git.1677142927.bf55c675/agents/scsi/fence_scsi.py   
2023-02-23 10:02:07.000000000 +0100
+++ new/fence-agents-4.12.1+git.1682325255.86f77326/agents/scsi/fence_scsi.py   
2023-04-24 10:34:15.000000000 +0200
@@ -314,7 +314,7 @@
        return devs
 
 
-def get_clvm_devices(options):
+def get_shared_devices(options):
        devs = []
        cmd = options["--vgs-path"] + " " +\
        "--noheadings " +\
@@ -324,10 +324,11 @@
        "--config 'global { locking_type = 0 } devices { preferred_names = [ 
\"^/dev/dm\" ] }'"
        out = run_cmd(options, cmd)
        if out["rc"]:
-               fail_usage("Failed: Cannot get clvm devices")
-       for line in out["out"].split("\n"):
-               if 'c' in line.split(":")[0]:
-                       devs.append(line.split(":")[1])
+               fail_usage("Failed: Cannot get shared devices")
+       for line in out["out"].splitlines():
+               vg_attr, pv_name = line.strip().split(":")
+               if vg_attr[5] in "cs":
+                       devs.append(pv_name)
        return devs
 
 
@@ -612,7 +613,7 @@
        options["--key"] = options["--key"].lstrip('0')
 
        if not ("--devices" in options and options["--devices"].split(",")):
-               options["devices"] = get_clvm_devices(options)
+               options["devices"] = get_shared_devices(options)
        else:
                options["devices"] = options["--devices"].split(",")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fence-agents-4.12.1+git.1677142927.bf55c675/tests/data/metadata/fence_aliyun.xml
 
new/fence-agents-4.12.1+git.1682325255.86f77326/tests/data/metadata/fence_aliyun.xml
--- 
old/fence-agents-4.12.1+git.1677142927.bf55c675/tests/data/metadata/fence_aliyun.xml
        2023-02-23 10:02:07.000000000 +0100
+++ 
new/fence-agents-4.12.1+git.1682325255.86f77326/tests/data/metadata/fence_aliyun.xml
        2023-04-24 10:34:15.000000000 +0200
@@ -38,6 +38,11 @@
                <content type="string"  />
                <shortdesc lang="en">Ram Role.</shortdesc>
        </parameter>
+       <parameter name="filter" unique="0" required="0">
+               <getopt mixed="--filter=[key=value]" />
+               <content type="string"  />
+               <shortdesc lang="en">Filter for list-action.</shortdesc>
+       </parameter>
        <parameter name="quiet" unique="0" required="0">
                <getopt mixed="-q, --quiet" />
                <content type="boolean"  />
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fence-agents-4.12.1+git.1677142927.bf55c675/tests/data/metadata/fence_aws.xml
 
new/fence-agents-4.12.1+git.1682325255.86f77326/tests/data/metadata/fence_aws.xml
--- 
old/fence-agents-4.12.1+git.1677142927.bf55c675/tests/data/metadata/fence_aws.xml
   2023-02-23 10:02:07.000000000 +0100
+++ 
new/fence-agents-4.12.1+git.1682325255.86f77326/tests/data/metadata/fence_aws.xml
   2023-04-24 10:34:15.000000000 +0200
@@ -46,6 +46,11 @@
                <content type="string" default="False"  />
                <shortdesc lang="en">Boto Lib debug</shortdesc>
        </parameter>
+       <parameter name="skip_race_check" unique="0" required="0">
+               <getopt mixed="--skip-race-check" />
+               <content type="boolean"  />
+               <shortdesc lang="en">Skip race condition check</shortdesc>
+       </parameter>
        <parameter name="quiet" unique="0" required="0">
                <getopt mixed="-q, --quiet" />
                <content type="boolean"  />
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fence-agents-4.12.1+git.1677142927.bf55c675/tests/data/metadata/fence_gce.xml
 
new/fence-agents-4.12.1+git.1682325255.86f77326/tests/data/metadata/fence_gce.xml
--- 
old/fence-agents-4.12.1+git.1677142927.bf55c675/tests/data/metadata/fence_gce.xml
   2023-02-23 10:02:07.000000000 +0100
+++ 
new/fence-agents-4.12.1+git.1682325255.86f77326/tests/data/metadata/fence_gce.xml
   2023-04-24 10:34:15.000000000 +0200
@@ -91,7 +91,7 @@
        <parameter name="earlyexit" unique="0" required="0">
                <getopt mixed="--earlyexit" />
                <content type="boolean"  />
-               <shortdesc lang="en">If an existing reset operation is 
detected, the fence agent will return before the operation completes with a 0 
return code.</shortdesc>
+               <shortdesc lang="en">If running set_power_status and existing 
reset operation is detected or runnning power_cycle, the fence agent will 
return before the operation completes with a 0 return code.</shortdesc>
        </parameter>
        <parameter name="warntimeout" unique="0" required="0">
                <getopt mixed="--warntimeout=[warn_timeout]" />

Reply via email to