public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Daniel Kral <d.kral@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH ha-manager 1/2] rules: ensure rule is defined and has type in set_rule_defaults
Date: Thu, 12 Mar 2026 10:49:15 +0100	[thread overview]
Message-ID: <f8f178cc-a0e7-4a98-812c-e5f55cddde9f@proxmox.com> (raw)
In-Reply-To: <20260311125008.271334-2-d.kral@proxmox.com>

Just a note for the future: please also include the bug number in the
commit title, so it can also be seen in one-line git history. From the
developer documentation [0]:
If the commit fixes a bug start with that information in this form:
fix #1234: summary here

[0]:
https://pve.proxmox.com/wiki/Developer_Documentation#Commits_and_Commit_Messages

Am 11.03.26 um 1:50 PM schrieb Daniel Kral:
> If the rule is not defined or does not have a type set, there are no
> optional property defaults to set.
> 
> This prevents users of set_rule_defaults(...) to have to deal with
> unnecessary error handling.
> 
> Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7399
> Signed-off-by: Daniel Kral <d.kral@proxmox.com>
> ---
>  src/PVE/HA/Rules.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/HA/Rules.pm b/src/PVE/HA/Rules.pm
> index 38c57548..3a14eeb3 100644
> --- a/src/PVE/HA/Rules.pm
> +++ b/src/PVE/HA/Rules.pm
> @@ -274,7 +274,8 @@ haven't been explicitly set yet.
>  sub set_rule_defaults {
>      my ($class, $rule) = @_;
>  
> -    if (my $plugin = $class->lookup($rule->{type})) {
> +    if ($rule && $rule->{type}) {
> +        my $plugin = $class->lookup($rule->{type});
>          my $properties = $plugin->properties();
>  
>          for my $prop (keys %$properties) {





  reply	other threads:[~2026-03-12  9:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 12:49 [PATCH ha-manager 0/2] fix #7399: check if required rule props are set Daniel Kral
2026-03-11 12:49 ` [PATCH ha-manager 1/2] rules: ensure rule is defined and has type in set_rule_defaults Daniel Kral
2026-03-12  9:49   ` Fiona Ebner [this message]
2026-03-11 12:49 ` [PATCH ha-manager 2/2] api: rules: check for non-empty nodes and resources properties Daniel Kral
2026-03-11 17:06 ` applied: [PATCH ha-manager 0/2] fix #7399: check if required rule props are set Thomas Lamprecht
2026-03-12  8:43   ` Daniel Kral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8f178cc-a0e7-4a98-812c-e5f55cddde9f@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=d.kral@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal