On a narrow terminal it is difficult to follow the output. This merges a
series of message lines into one debug output call to help legibility
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This was triggered by a call to admin_up() that was passing self.lfclient_url as an un-named parameter, creating
unanswerable requests formatted like http://localhost:8080/http:/localhost:8080/. There should really only be
one http[s]*:// pattern in a URL, and further instances of colons should be URL encoded to %3A.
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This change hooks into the global python logging instance and exercises level based logging
without more advanced logic like "digest/json/http/gui" as documented elsewhere. Need to
establish the correctness of this usage before moving forward.
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2. add import re to lfcli_base
3. add debug output to l3_cxprofile, so it is how it used to be
4. add help options to regression_test so we can test how the help flags are working
5. Make test_ip_variable_time work better when it is imported directly by moving most of the logic to a function under IPVariableTime
6. Add init.py file to the LANforge directory and fix archiving in the to_pip.py script
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
- Import importlib, os, and sys to each python script.
- Append "lanforge-scripts" root directory to the system path, allowing each script to be called from an antecedent directory. e.g.
if 'lanforge-scripts' not in sys.path:
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../../")))
- All statements of the form 'from <module> import <class>' replace with:
<module> = importlib.import_module("lanforge-scripts.<directory>.<module>")
<class> = <module>.<class>
print_diagnostics extracts X-Error headers first
LFRequest can track errors in self.error_list
LFReuqest can print errors
Classes lf lfcli_base calling lfrequest.get_as_json() can expose 404 or other errors using lfrequest.print_errors()
Signed-off-by: Jed Reynolds <jed@candelatech.com>
- headers not shown on 200 or 404
- headers not shown unless die_on_error_
- short 404 message now used
Signed-off-by: Jed Reynolds <jed@candelatech.com>
This lets scripts wait until we are sure the system can handle
further work.
Ensure we print out error in case the URL processing logic
detects and error and plans to exit.