Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.7.11 #4417

Merged
merged 74 commits into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
d0bd1ad
Fixes: #4255 - Add new script variable types based on dynamic model f…
DanSheps Feb 24, 2020
a585342
Update __all__ for #4255
DanSheps Feb 24, 2020
8ed0d04
Add tests
DanSheps Feb 24, 2020
27e3b6f
Remove second variables, make widget mandatory on ObjectVar and Multi…
DanSheps Feb 27, 2020
2fcdc90
Automatically check for new versions
steffann Jan 23, 2020
405d93c
Update versions.py
steffann Jan 24, 2020
9d66ac4
Refactor the code to be more readable
steffann Jan 24, 2020
008fc56
Full URL for API, more consistent naming, only enabled for staff and …
steffann Jan 26, 2020
3a08496
Rename settings to be more generic, not GitHub-only
steffann Feb 27, 2020
8d92089
Improve comments and error message on invalid characters in URL
steffann Feb 27, 2020
0de7f47
Fix check for permissions
steffann Feb 27, 2020
22ac9f6
Don't overwrite the header block, append to it
steffann Feb 27, 2020
8ce106c
Move request to background task
steffann Feb 27, 2020
28473fa
Disable update check by default
steffann Feb 27, 2020
fcf3b14
Add unittests
steffann Feb 27, 2020
113313e
Merge pull request #4001 from steffann/738-automatically-check-for-ne…
jeremystretch Mar 4, 2020
55558cb
Post-release version bump
jeremystretch Mar 10, 2020
a504f5f
closes #4340 - Enforce unique constraints for device and virtual mach…
lampwins Mar 10, 2020
79aba5e
Fixes #4343: Fix Markdown support for tables
jeremystretch Mar 11, 2020
5e97199
Closes #4362: Standardize URL for creation of RackReservations
jeremystretch Mar 12, 2020
a285090
Closes #4363: Standardize secret creation URL
jeremystretch Mar 13, 2020
1487b50
Closes #4309: Add descriptive tooltip to custom fields on object views
jeremystretch Mar 13, 2020
459bcd8
Fixes #4365: Fix exception raised on IP address bulk add view
jeremystretch Mar 13, 2020
1f382f9
Merge branch 'develop' into 738-detect-new-releases
jeremystretch Mar 13, 2020
f6dfd2f
Simplify update repo URL validation
jeremystretch Mar 13, 2020
e2123f4
Clean up logging
jeremystretch Mar 13, 2020
2033d15
Tweak UPDATE_REPO_URL to convey the full URL
jeremystretch Mar 13, 2020
9e45caf
Cleaned up new release notification banner
jeremystretch Mar 13, 2020
c5776d9
Closes #4369: Add a dedicated view for rack reservations
jeremystretch Mar 13, 2020
9466802
closes #4368 - extras features model registration
lampwins Mar 14, 2020
7ef9a6c
Fixes #2769: improve prefix_length validations
kobayashi Mar 16, 2020
62ad773
Merge pull request #4373 from kobayashi/2769-validate-prefixlength
jeremystretch Mar 16, 2020
9a38586
rename FeatureQuery class
lampwins Mar 16, 2020
400f6fc
Dynamically resolve the API URL for dynamic choice fields
jeremystretch Mar 16, 2020
0068108
Remove APISelect widget/api_url argument from dynamic fields
jeremystretch Mar 16, 2020
73881ad
Change CircuitTerminationForm.site to a DynamicModelChoiceField
jeremystretch Mar 16, 2020
450615e
Change IPAddressForm.nat_vrf to DynamicModelChoiceField
jeremystretch Mar 16, 2020
00afe7a
Merge pull request #4375 from netbox-community/4374-dynamic-fields-ap…
jeremystretch Mar 16, 2020
3590ed3
Rename 'webhooks' REDIS config to 'tasks'
jeremystretch Mar 17, 2020
a2eb2e7
Introduce a new 'check_releases' RQ queue
jeremystretch Mar 17, 2020
ec2dc8d
Fix template logic
jeremystretch Mar 17, 2020
ab93606
Check for an existing job before queuing a new one
jeremystretch Mar 17, 2020
356de98
Tweak release template variables
jeremystretch Mar 17, 2020
3ace83c
Cache only the most recent NetBox release
jeremystretch Mar 17, 2020
2f12d09
Clean up URL damping
jeremystretch Mar 17, 2020
8128783
Update tests
jeremystretch Mar 17, 2020
1706db3
Fix Python 3.5 compatability for tests
jeremystretch Mar 17, 2020
022653f
Fix Python 3.5 compatability for tests
jeremystretch Mar 17, 2020
043b1c2
Refactor the registry into a dictionary object
jeremystretch Mar 18, 2020
70c2905
Raise specific exceptions
jeremystretch Mar 18, 2020
f7ba766
Merge pull request #4379 from netbox-community/refactor-registry
jeremystretch Mar 18, 2020
fe4f4bd
Tweaked logging; renamed release config parameters
jeremystretch Mar 18, 2020
7246fd6
Move releases.py to netbox/
jeremystretch Mar 18, 2020
dbbb2cd
Merge pull request #4366 from netbox-community/738-detect-new-releases
jeremystretch Mar 18, 2020
eab79fa
Changelog for #738
jeremystretch Mar 18, 2020
87f0b19
Closes #4380: Enable webhooks for rack reservations
jeremystretch Mar 18, 2020
a9d0454
Closes #4381: Enable export templates for rack reservations
jeremystretch Mar 18, 2020
7f55712
Closes #4382: Enable custom links for rack reservations
jeremystretch Mar 18, 2020
40bfb55
Improved cable tracing logic
jeremystretch Mar 19, 2020
e143158
Remove unused follow_circuits arg for cable tracing
jeremystretch Mar 19, 2020
0995e10
Modify script ObjectVars to use DynamicModelChoiceFields
DanSheps Mar 19, 2020
fa1548f
Remove extraneous import
DanSheps Mar 19, 2020
f1236e9
Tweak tracing logic to ensure consistent behavior
jeremystretch Mar 19, 2020
8d38018
Rewrite and extend cabling logic tests
jeremystretch Mar 19, 2020
33eb5e1
Merge pull request #4387 from netbox-community/3193-cable-tracing
jeremystretch Mar 19, 2020
ba6ce07
Changelog for #3193
jeremystretch Mar 19, 2020
2dff093
Merge pull request #4258 from netbox-community/4255-dynamic_object_vars
jeremystretch Mar 19, 2020
533521b
Changelog for #4255
jeremystretch Mar 19, 2020
05fdf5e
Closes #4386: Update admin links for Django RQ to reflect multiple qu…
jeremystretch Mar 19, 2020
058c78d
Closes #4389: Add a bulk edit view for device bays
jeremystretch Mar 19, 2020
66a99e1
Fix up styling of tables in documentation
jeremystretch Mar 26, 2020
785119f
Fixes: #4415 - Add site on validate_unique() for device model
DanSheps Mar 27, 2020
9c1eda0
Closes #4404: Add cable trace button for circuit terminations
jeremystretch Mar 27, 2020
59e6386
Release v2.7.11
jeremystretch Mar 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/configuration/optional-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,24 @@ When determining the primary IP address for a device, IPv6 is preferred over IPv

---

## RELEASE_CHECK_TIMEOUT

Default: 86,400 (24 hours)

The number of seconds to retain the latest version that is fetched from the GitHub API before automatically invalidating it and fetching it from the API again. This must be set to at least one hour (3600 seconds).

---

## RELEASE_CHECK_URL

Default: None

The releases of this repository are checked to detect new releases, which are shown on the home page of the web interface. You can change this to your own fork of the NetBox repository, or set it to `None` to disable the check. The URL provided **must** be compatible with the GitHub API.

Use `'https://api.github.com/repos/netbox-community/netbox/releases'` to check for release in the official NetBox repository.

---

## REPORTS_ROOT

Default: $BASE_DIR/netbox/reports/
Expand Down
16 changes: 8 additions & 8 deletions docs/configuration/required-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ DATABASE = {
[Redis](https://redis.io/) is an in-memory data store similar to memcached. While Redis has been an optional component of
NetBox since the introduction of webhooks in version 2.4, it is required starting in 2.6 to support NetBox's caching
functionality (as well as other planned features). In 2.7, the connection settings were broken down into two sections for
webhooks and caching, allowing the user to connect to different Redis instances/databases per feature.
task queuing and caching, allowing the user to connect to different Redis instances/databases per feature.

Redis is configured using a configuration setting similar to `DATABASE` and these settings are the same for both of the `webhooks` and `caching` subsections:
Redis is configured using a configuration setting similar to `DATABASE` and these settings are the same for both of the `tasks` and `caching` subsections:

* `HOST` - Name or IP address of the Redis server (use `localhost` if running locally)
* `PORT` - TCP port of the Redis service; leave blank for default port (6379)
Expand All @@ -61,7 +61,7 @@ Example:

```python
REDIS = {
'webhooks': {
'tasks': {
'HOST': 'redis.example.com',
'PORT': 1234,
'PASSWORD': 'foobar',
Expand All @@ -84,9 +84,9 @@ REDIS = {
If you are upgrading from a version prior to v2.7, please note that the Redis connection configuration settings have
changed. Manual modification to bring the `REDIS` section inline with the above specification is necessary

!!! note
It is highly recommended to keep the webhook and cache databases separate. Using the same database number on the
same Redis instance for both may result in webhook processing data being lost during cache flushing events.
!!! warning
It is highly recommended to keep the task and cache databases separate. Using the same database number on the
same Redis instance for both may result in queued background tasks being lost during cache flushing events.

### Using Redis Sentinel

Expand All @@ -102,7 +102,7 @@ Example:

```python
REDIS = {
'webhooks': {
'tasks': {
'SENTINELS': [('mysentinel.redis.example.com', 6379)],
'SENTINEL_SERVICE': 'netbox',
'PASSWORD': '',
Expand All @@ -126,7 +126,7 @@ REDIS = {

!!! note
It is possible to have only one or the other Redis configurations to use Sentinel functionality. It is possible
for example to have the webhook use sentinel via `HOST`/`PORT` and for caching to use Sentinel via
for example to have the tasks database use sentinel via `HOST`/`PORT` and for caching to use Sentinel via
`SENTINELS`/`SENTINEL_SERVICE`.


Expand Down
12 changes: 12 additions & 0 deletions docs/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Custom table styling */
table {
margin-bottom: 24px;
width: 100%;
}
th {
background-color: #f0f0f0;
padding: 6px;
}
td {
padding: 6px;
}
2 changes: 1 addition & 1 deletion docs/installation/3-netbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Redis is a in-memory key-value store required as part of the NetBox installation

```python
REDIS = {
'webhooks': {
'tasks': {
'HOST': 'redis.example.com',
'PORT': 1234,
'PASSWORD': 'foobar',
Expand Down
26 changes: 26 additions & 0 deletions docs/release-notes/version-2.7.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# NetBox v2.7 Release Notes

## v2.7.11 (2020-03-27)

### Enhancements

* [#738](https://github.com/netbox-community/netbox/issues/738) - Add ability to automatically check for new releases (must be enabled by setting `RELEASE_CHECK_URL`)
* [#4255](https://github.com/netbox-community/netbox/issues/4255) - Custom script object variables now utilize dynamic form widgets
* [#4309](https://github.com/netbox-community/netbox/issues/4309) - Add descriptive tooltip to custom fields on object views
* [#4369](https://github.com/netbox-community/netbox/issues/4369) - Add a dedicated view for rack reservations
* [#4380](https://github.com/netbox-community/netbox/issues/4380) - Enable webhooks for rack reservations
* [#4381](https://github.com/netbox-community/netbox/issues/4381) - Enable export templates for rack reservations
* [#4382](https://github.com/netbox-community/netbox/issues/4382) - Enable custom links for rack reservations
* [#4386](https://github.com/netbox-community/netbox/issues/4386) - Update admin links for Django RQ to reflect multiple queues
* [#4389](https://github.com/netbox-community/netbox/issues/4389) - Add a bulk edit view for device bays
* [#4404](https://github.com/netbox-community/netbox/issues/4404) - Add cable trace button for circuit terminations

### Bug Fixes

* [#2769](https://github.com/netbox-community/netbox/issues/2769) - Improve `prefix_length` validation on available-prefixes API
* [#3193](https://github.com/netbox-community/netbox/issues/3193) - Fix cable tracing across multiple rear ports
* [#4340](https://github.com/netbox-community/netbox/issues/4340) - Enforce unique constraints for device and virtual machine names in the API
* [#4343](https://github.com/netbox-community/netbox/issues/4343) - Fix Markdown support for tables
* [#4365](https://github.com/netbox-community/netbox/issues/4365) - Fix exception raised on IP address bulk add view
* [#4415](https://github.com/netbox-community/netbox/issues/4415) - Fix duplicate name validation on device model

---

## v2.7.10 (2020-03-10)

**Note:** If your deployment requires any non-core Python packages (such as `napalm`, `django-storages`, or `django-auth-ldap`), list them in a file named `local_requirements.txt` in the NetBox root directory (alongside `requirements.txt`). This will ensure they are detected and re-installed by the upgrade script when the Python virtual environment is rebuilt.
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ python:
theme:
name: readthedocs
navigation_depth: 3
extra_css:
- extra.css
markdown_extensions:
- admonition:
- markdown_include.include:
headingOffset: 1

nav:
- Introduction: 'index.md'
- Installation:
Expand Down
37 changes: 8 additions & 29 deletions netbox/circuits/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class ProviderFilterForm(BootstrapMixin, CustomFieldFilterForm):
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/dcim/regions/",
value_field="slug",
filter_for={
'site': 'region'
Expand All @@ -125,7 +124,6 @@ class ProviderFilterForm(BootstrapMixin, CustomFieldFilterForm):
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/dcim/sites/",
value_field="slug",
)
)
Expand Down Expand Up @@ -167,16 +165,10 @@ class Meta:

class CircuitForm(BootstrapMixin, TenancyForm, CustomFieldModelForm):
provider = DynamicModelChoiceField(
queryset=Provider.objects.all(),
widget=APISelect(
api_url="/api/circuits/providers/"
)
queryset=Provider.objects.all()
)
type = DynamicModelChoiceField(
queryset=CircuitType.objects.all(),
widget=APISelect(
api_url="/api/circuits/circuit-types/"
)
queryset=CircuitType.objects.all()
)
comments = CommentField()
tags = TagField(
Expand Down Expand Up @@ -245,17 +237,11 @@ class CircuitBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEdit
)
type = DynamicModelChoiceField(
queryset=CircuitType.objects.all(),
required=False,
widget=APISelect(
api_url="/api/circuits/circuit-types/"
)
required=False
)
provider = DynamicModelChoiceField(
queryset=Provider.objects.all(),
required=False,
widget=APISelect(
api_url="/api/circuits/providers/"
)
required=False
)
status = forms.ChoiceField(
choices=add_blank_choice(CircuitStatusChoices),
Expand All @@ -265,10 +251,7 @@ class CircuitBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEdit
)
tenant = DynamicModelChoiceField(
queryset=Tenant.objects.all(),
required=False,
widget=APISelect(
api_url="/api/tenancy/tenants/"
)
required=False
)
commit_rate = forms.IntegerField(
required=False,
Expand Down Expand Up @@ -303,7 +286,6 @@ class CircuitFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/circuits/circuit-types/",
value_field="slug",
)
)
Expand All @@ -312,7 +294,6 @@ class CircuitFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/circuits/providers/",
value_field="slug",
)
)
Expand All @@ -326,7 +307,6 @@ class CircuitFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/dcim/regions/",
value_field="slug",
filter_for={
'site': 'region'
Expand All @@ -338,7 +318,6 @@ class CircuitFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/dcim/sites/",
value_field="slug",
)
)
Expand All @@ -355,6 +334,9 @@ class CircuitFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm
#

class CircuitTerminationForm(BootstrapMixin, forms.ModelForm):
site = DynamicModelChoiceField(
queryset=Site.objects.all()
)

class Meta:
model = CircuitTermination
Expand All @@ -368,7 +350,4 @@ class Meta:
}
widgets = {
'term_side': forms.HiddenInput(),
'site': APISelect(
api_url="/api/dcim/sites/"
)
}
3 changes: 3 additions & 0 deletions netbox/circuits/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from dcim.fields import ASNField
from dcim.models import CableTermination
from extras.models import CustomFieldModel, ObjectChange, TaggedItem
from extras.utils import extras_features
from utilities.models import ChangeLoggedModel
from utilities.utils import serialize_object
from .choices import *
Expand All @@ -21,6 +22,7 @@
)


@extras_features('custom_fields', 'custom_links', 'graphs', 'export_templates', 'webhooks')
class Provider(ChangeLoggedModel, CustomFieldModel):
"""
Each Circuit belongs to a Provider. This is usually a telecommunications company or similar organization. This model
Expand Down Expand Up @@ -131,6 +133,7 @@ def to_csv(self):
)


@extras_features('custom_fields', 'custom_links', 'export_templates', 'webhooks')
class Circuit(ChangeLoggedModel, CustomFieldModel):
"""
A communications circuit connects two points. Each Circuit belongs to a Provider; Providers may have multiple
Expand Down
2 changes: 1 addition & 1 deletion netbox/dcim/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def trace(self, request, pk):
# Initialize the path array
path = []

for near_end, cable, far_end in obj.trace(follow_circuits=True):
for near_end, cable, far_end in obj.trace():

# Serialize each object
serializer_a = get_serializer_for_model(near_end, prefix='Nested')
Expand Down
Loading