faucetsdn / faucetagent

gNMI agent for faucet configuration
4 stars 2 forks source link

Key Error on previous versions of Faucet #19

Closed cglewis closed 5 years ago

cglewis commented 5 years ago

If running an older version of Faucet, the Faucet Agent will throw a key error, rather than handling the exception and logging that a newer version of Faucet is needed. What is the lowest version of Faucet that supports this needed key?

INFO:faucetagent:Starting FAUCET gNMI configuration agent on port 10161
DEBUG:faucetagent:Capabilities()
DEBUG:faucetagent:Set(replace {
  path {
  }
  val {
    string_val: "\nvlans:\n  office:\n    vid: 100\n  guest:\n    vid: 200\n\ndps:\n  s1:\n    dp_id: 0x1\n    hardware: \"Open vSwitch\"\n    interfaces:\n      1:\n        name: \"h1\"\n        native_vlan: office\n      2:\n        name: \"h2\"\n        native_vlan: guest\n      3:\n        name: \"link\"\n        tagged_vlans: [office, guest]\n  s2:\n    dp_id: 0x2\n    hardware: \"Open vSwitch\"\n    interfaces:\n      1:\n        name: \"h3\"\n        native_vlan: office\n      2:\n        name: \"h4\"\n        native_vlan: guest\n      3:\n        name: \"link\"\n        tagged_vlans: [office, guest]\n"
  }
}
)
DEBUG:faucetagent:Writing FAUCET config
DEBUG:faucetagent:Reloading FAUCET config
DEBUG:faucetagent:Sending HUP (config reload signal) to FAUCET
9302/tcp:            18113
DEBUG:faucetagent:Waiting for FAUCET config (re)load
DEBUG:faucetagent:faucet_config_applied not found (possibly unsupported?)
DEBUG:faucetagent:fetch_status: StatusTuple(faucet_config_hash_info={'/faucetagent/faucet.yaml': '5d0f9d54e73852c87cd18fdecc1eb2c6f06332803e602d5cd94fbde606870f0f'}, faucet_config_hash_func={'algorithm': 'sha256'}, faucet_config_load_error=0.0, faucet_config_applied=1.0)
ERROR:grpc._server:Exception calling application: 'config_files'
Traceback (most recent call last):
  File "/home/.local/lib/python3.5/site-packages/grpc/_server.py", line 392, in _call_behavior
    return behavior(argument, context), True
  File "./faucetagent.py", line 280, in Set
    self.faucet.write_config(replace.val.string_val)
  File "./faucetagent.py", line 202, in write_config
    self.reload(config=data)
  File "./faucetagent.py", line 182, in reload
    if self._check_status(status, config):
  File "./faucetagent.py", line 164, in _check_status
    return (status and self._check_hash(status, config)
  File "./faucetagent.py", line 133, in _check_hash
    files = status.faucet_config_hash_info['config_files'].split(',')
KeyError: 'config_files'
lantz commented 5 years ago

@cglewis @anarkiwi @gizmoguy

It should work with FAUCET 1.9.3 and later.

There used to be a check for this, but I asked the dev team (I think you might have been in the meeting?) whether it was necessary, and the decision, as I understood it at least, was to remove it. Do you all think we should put it back?

lantz commented 5 years ago

20 adds the FAUCET version requirement to README.md

lantz commented 5 years ago

Documented in README.md