Skip to content

Commit ba93115

Browse files
committed
Enforce install of DRF<3.7.0 for unsupported NetBox releases (#21)\nMerge branch 'fix/DRF-3.7-compat-issue' into master
2 parents 0693b43 + 594dea2 commit ba93115

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tasks/deploy_netbox.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
when:
1515
- netbox_config.SECRET_KEY is not defined
1616

17+
- name: Pin Django REST Framework dependency to under 3.7.0 for NetBox 2.1.5 and below
18+
replace:
19+
path: "{{ netbox_current_path }}/requirements.txt"
20+
regexp: '^(djangorestframework>=\d+\.\d+(\.\d+)?)$'
21+
replace: '\1,<3.7.0'
22+
when:
23+
- (netbox_stable and netbox_stable_version | version_compare('2.1.5', '<=')) or (netbox_git and __netbox_git_contains_issue_1563_fix.rc == 1)
24+
1725
- name: Create NetBox virtualenv and install needed Python dependencies
1826
pip:
1927
requirements: "{{ netbox_current_path }}/requirements.txt"

tasks/install_via_git.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
when:
2626
- __netbox_git_contains_media_root_change.rc == 0 and "MEDIA_ROOT" not in netbox_config
2727

28+
- name: Check existence of commit 97188ad, fixing issue netbox#1563
29+
shell: 'git log --format=%H "{{ netbox_git_version }}" | grep ^97188ad85ba77d361ae38d8b5e01ae9109e5e9bd'
30+
args:
31+
chdir: "{{ netbox_git_repo_path }}"
32+
register: __netbox_git_contains_issue_1563_fix
33+
changed_when: False
34+
failed_when: "__netbox_git_contains_issue_1563_fix.rc not in [0, 1]"
35+
2836
- name: Archive and extract snapshot of git repository
2937
shell: 'git archive "{{ netbox_git_version }}" | tar -x -C "{{ netbox_git_deploy_path }}"'
3038
args:

0 commit comments

Comments
 (0)