This looks good as a fix, but I think you should drop now almost dead-code. I won't block on that (also because I get back only the second week of 2017).
A few of the suggestions I am not sure about: files as context managers would be much nicer, but not sure if landscape-client needs to support precise or whatever other Ubuntu release and what Python is there and if it supports using file objects as context managers (though https://docs.python.org/2/library/stdtypes.html#bltin-file-objects says that this is supported since 2.6, so I guess we are safe).
This looks good as a fix, but I think you should drop now almost dead-code. I won't block on that (also because I get back only the second week of 2017).
A few of the suggestions I am not sure about: files as context managers would be much nicer, but not sure if landscape-client needs to support precise or whatever other Ubuntu release and what Python is there and if it supports using file objects as context managers (though https:/ /docs.python. org/2/library/ stdtypes. html#bltin- file-objects says that this is supported since 2.6, so I guess we are safe).