Your message dated Thu, 12 Dec 2019 22:03:13 +0100
with message-id <9e3ee8e6-e325-a07a-ed5b-d171d1431...@debian.org>
and subject line Re: Bug#946630: openstack-cluster-installer-agent: syntax error
has caused the Debian Bug report #946630,
regarding openstack-cluster-installer-agent: syntax error
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
946630: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946630
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: openstack-cluster-installer
Version: 21
Severity: grave
Justification: makes the package unusable

The agent contains the following on line 29:

        ETH_SPEED=$(( $(lshw -class network 2>/dev/null -json | jq '.[] | 
select(.serial|test("'${MAC_ADDR}'")) | .capacity') / 1000000))

The shell redirect ("2>/dev/null") means the shell stops passing
command-line arguments from there on, which means the "-json" is never
seen by lshw, which in turn means the "jq" command doesn't get any JSON
data.

This results in an error message of the type

bash: / 1000000 : syntax error: operand expected (error token is "/ 1000000")

upon which the agent stops working, and nothing is added to oci's
database.

(this may be fixed in later versions, didn't check, but this is what's in
stable...)

--- End Message ---
--- Begin Message ---
On 12/12/19 11:40 AM, Wouter Verhelst wrote:
> Source: openstack-cluster-installer
> Version: 21
> Severity: grave
> Justification: makes the package unusable
> 
> The agent contains the following on line 29:
> 
>         ETH_SPEED=$(( $(lshw -class network 2>/dev/null -json | jq '.[] | 
> select(.serial|test("'${MAC_ADDR}'")) | .capacity') / 1000000))
> 
> The shell redirect ("2>/dev/null") means the shell stops passing
> command-line arguments from there on, which means the "-json" is never
> seen by lshw, which in turn means the "jq" command doesn't get any JSON
> data.

Well, no! Though I agree it's an ugly way to write things (and I'm
fixing it right away in the Git), it still works. Try yourself, it did
work for me on my shell:

# lshw -class network 2>/dev/null -json \
 | jq '.[] | select(.serial|test("08:00:27:06:cc:d3")) | .capacity'
1000000000

However, the stable version is affected by an issue where the above
command line needs, at the end:

| head -n 1

as in some configuration, it may happen that there's multiple lines, and
then the calculation fails.

> This results in an error message of the type
> 
> bash: / 1000000 : syntax error: operand expected (error token is "/ 1000000")

Yup, that's what happens when the head -n 1 is missing, but that's not a
problem in all configurations.

Cheers,

Thomas Goirand (zigo)

--- End Message ---

Reply via email to