]> git.proxmox.com Git - mirror_ifupdown2.git/commit - etc/network/ifupdown2/ifupdown2.conf
Add support to display status (pass, fail) in ifquery --check json output
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Fri, 18 Sep 2015 04:57:06 +0000 (21:57 -0700)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Fri, 18 Sep 2015 04:57:06 +0000 (21:57 -0700)
commitfb10449e5521163a4d7282d09d110a0bd8f3ecf2
tree061537d0058679446b6255506740ab02eb8706c2
parent264dcaa073ed44bf3bbf4d8f7148fdea614144a9
Add support to display status (pass, fail) in ifquery --check json output

Ticket: CM-7464
Reviewed By: CCR-3507
Testing Done: Tested ifquery check sanity

ifquery --check non-json output displays 'pass' and 'fail' for
each attribute on the same line (see below). This output is not json
friendly. For json, include status in 'config_status' a dictionary
whose keys are similar to the 'config' dictionary but values are status
for the corresponding keys in the 'config' dictionary (see example below)

auto bond4
iface bond4 inet static
[pass]
    bond-mode 802.3ad                                           [pass]
    bond-miimon 100                                             [pass]
    bond-use-carrier 1                                          [pass]
    bond-lacp-rate 1                                            [pass]
    bond-min-links 1                                            [pass]
    bond-xmit-hash-policy layer3+4                              [pass]
    bond-slaves swp3 swp4                                       [pass]

[
  {
    "name": "bond4",
    "addr_method": "static",
    "addr_family": "inet",
    "auto": true,
    "config": {
      "bond-use-carrier": "1",
      "bond-miimon": "100",
      "bond-lacp-rate": "1",
      "bond-min-links": "1",
      "bond-slaves": "swp3 swp4",
      "bond-mode": "802.3ad",
      "bond-xmit-hash-policy": "layer3+4"
    },
    "config_status": {
      "bond-use-carrier": "pass",
      "bond-miimon": "pass",
      "bond-lacp-rate": "pass",
      "bond-min-links": "pass",
      "bond-slaves": "pass",
      "bond-mode": "pass",
      "bond-xmit-hash-policy": "pass"
    },
    "status": "pass"
  }
]
config/ifupdown2.conf
ifupdown/iface.py
ifupdown/ifupdownmain.py