pybatfish icon indicating copy to clipboard operation
pybatfish copied to clipboard

Port all WorkMgrV1 calls to WorkMgrV2 calls when available

Open arifogel opened this issue 2 years ago • 3 comments

  • add version check on Session initialization to determine whether to use only v2 calls or use legacy v1 calls
  • can force behavior without query by setting environment variable pybf_use_deprecated_workmgr_v1 to 0 or 1, or by passing use_deprecated_workmgr_v1=True/False to Session.__init__

arifogel avatar Aug 11 '22 19:08 arifogel

This change is Reviewable

batfish-bot avatar Aug 11 '22 19:08 batfish-bot

Codecov Report

Merging #851 (a5b004a) into master (c8b54d8) will increase coverage by 0.32%. The diff coverage is 88.59%.

@@            Coverage Diff             @@
##           master     #851      +/-   ##
==========================================
+ Coverage   86.23%   86.56%   +0.32%     
==========================================
  Files          30       30              
  Lines        3851     3951     +100     
  Branches      644      664      +20     
==========================================
+ Hits         3321     3420      +99     
+ Misses        387      384       -3     
- Partials      143      147       +4     
Impacted Files Coverage Δ
pybatfish/question/question.py 82.62% <ø> (ø)
pybatfish/client/session.py 80.88% <81.69%> (+1.25%) :arrow_up:
pybatfish/client/workitem.py 84.21% <88.88%> (+1.85%) :arrow_up:
pybatfish/client/workhelper.py 76.63% <90.00%> (+3.48%) :arrow_up:
pybatfish/client/restv2helper.py 70.52% <97.22%> (+3.85%) :arrow_up:
pybatfish/client/consts.py 100.00% <100.00%> (ø)
pybatfish/client/internal.py 83.33% <100.00%> (ø)
pybatfish/client/resthelper.py 75.00% <100.00%> (+0.58%) :arrow_up:

codecov[bot] avatar Aug 12 '22 00:08 codecov[bot]

a discussion (no related file): Adding a new batfish endpoint for getting api version. Will switch over once merged.

arifogel avatar Aug 12 '22 20:08 arifogel