HewlettPackard / python-ilorest-library

Python library for interacting with devices which support a Redfish Service
Apache License 2.0
184 stars 91 forks source link

--json flag outputs invalid JSON #163

Open leorio1 opened 1 month ago

leorio1 commented 1 month ago

When using commands with the --json flag, a string with "Discovering data..." is prepended, making the output invalid JSON. Adding the --nologo flag does not help:

/usr/sbin/ilorest storagecontroller --url=test --json --nologo --user root 

Password: 
Discovering data...Done
{
  "DE00A000": {
    "Health": "OK",
    "Name": "HPE MR416i-o Gen11",
    "State": "Enabled"
  }
}

/usr/sbin/ilorest storagecontroller --url=test --json --nologo --user root | jq

parse error: Invalid numeric literal at line 1, column 12

Removing the "Discovering data" string results in valid JSON:

/usr/sbin/ilorest storagecontroller --url=test --json --nologo --user root | grep -v Discovering | jq

{
  "DE07C000": {
    "Health": "Enabled",
    "Name": "HPE Smart Array P816i-a SR Gen10",
    "State": "OK"
  }
}

Is there a way to remove "Discovering data" from output automatically?

rajeevkallur commented 1 month ago

Evaluating