Skip to content

Commit

Permalink
Merge pull request #1903 from digitalocean/develop
Browse files Browse the repository at this point in the history
Release v2.2.10
  • Loading branch information
jeremystretch authored Feb 21, 2018
2 parents 6436d70 + 8b5dba2 commit c4f7e81
Show file tree
Hide file tree
Showing 80 changed files with 933 additions and 648 deletions.
52 changes: 29 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@ We have established a Google Groups Mailing List for issues and general
discussion. This is the best forum for obtaining assistance with NetBox
installation. You can find us [here](https://groups.google.com/forum/#!forum/netbox-discuss).

### Freenode IRC
### Slack

For real-time discussion, you can join the #netbox channel on [Freenode](https://freenode.net/).
You can connect to Freenode at irc.freenode.net using an IRC client, or you can
use their [webchat client](https://webchat.freenode.net/).
For real-time discussion, you can join the #netbox Slack channel on [NetworkToCode](https://slack.networktocode.com/).

## Reporting Bugs

* First, ensure that you've installed the [latest stable version](https://github.com/digitalocean/netbox/releases) of
NetBox. If you're running an older version, it's possible that the bug has
* First, ensure that you've installed the [latest stable version](https://github.com/digitalocean/netbox/releases)
of NetBox. If you're running an older version, it's possible that the bug has
already been fixed.

* Next, check the GitHub [issues list](https://github.com/digitalocean/netbox/issues) to see if the bug you've found has already
been reported. If you think you may be experiencing a reported issue that
hasn't already been resolved, please click "add a reaction" in the top right
corner of the issue and add a thumbs up (+1). You mightalso want to add a
comment describing how it's affecting your installation. This will allow us to
prioritize bugs based on how many users are affected.
* Next, check the GitHub [issues list](https://github.com/digitalocean/netbox/issues)
to see if the bug you've found has already been reported. If you think you may
be experiencing a reported issue that hasn't already been resolved, please
click "add a reaction" in the top right corner of the issue and add a thumbs
up (+1). You mightalso want to add a comment describing how it's affecting your
installation. This will allow us to prioritize bugs based on how many users are
affected.

* If you haven't found an existing issue that describes your suspected bug,
please inquire about it on the mailing list. **Do not** file an issue until you
Expand All @@ -44,23 +43,23 @@ include:

* Please avoid prepending any sort of tag (e.g. "[Bug]") to the issue title.
The issue will be reviewed by a moderator after submission and the appropriate
labels will be applied.
labels will be applied for categorization.

* Keep in mind that we prioritize bugs based on their severity and how much
work is required to resolve them. It may take some time for someone to address
your issue.

## Feature Requests

* First, check the GitHub [issues list](https://github.com/digitalocean/netbox/issues) to see if the feature you're requesting
is already listed. (Be sure to search closed issues as well, since some
feature requests have been rejected.) If the feature you'd like to see has
already been requested and is open, click "add a reaction" in the top right
corner of the issue and add a thumbs up (+1). This ensures that the issue has
a better chance of receiving attention. Also feel free to add a comment with
any additional justification for the feature. (However, note that comments with
no substance other than a "+1" will be deleted. Please use GitHub's reactions
feature to indicate your support.)
* First, check the GitHub [issues list](https://github.com/digitalocean/netbox/issues)
to see if the feature you're requesting is already listed. (Be sure to search
closed issues as well, since some feature requests have been rejected.) If the
feature you'd like to see has already been requested and is open, click "add a
reaction" in the top right corner of the issue and add a thumbs up (+1). This
ensures that the issue has a better chance of receiving attention. Also feel
free to add a comment with any additional justification for the feature.
(However, note that comments with no substance other than a "+1" will be
deleted. Please use GitHub's reactions feature to indicate your support.)

* Due to an excessive backlog of feature requests, we are not currently
accepting any proposals which substantially extend NetBox's functionality
Expand Down Expand Up @@ -88,7 +87,7 @@ following:

* Please avoid prepending any sort of tag (e.g. "[Feature]") to the issue
title. The issue will be reviewed by a moderator after submission and the
appropriate labels will be applied.
appropriate labels will be applied for categorization.

## Submitting Pull Requests

Expand All @@ -109,3 +108,10 @@ these checks):
* All tests pass when run with `./manage.py test`
* PEP 8 compliance is enforced, with the exception that lines may be
greater than 80 characters in length

## Commenting

Only comment on an issue if you are sharing a relevant idea or constructive
feedback. **Do not** comment on an issue just to show your support (give the
top post a :+1: instead) or ask for an ETA. These comments will be deleted to
reduce noise in the discussion.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
![NetBox](docs/netbox_logo.png "NetBox logo")

NetBox is an IP address management (IPAM) and data center infrastructure management (DCIM) tool. Initially conceived by the network engineering team at [DigitalOcean](https://www.digitalocean.com/), NetBox was developed specifically to address the needs of network and infrastructure engineers.
NetBox is an IP address management (IPAM) and data center infrastructure
management (DCIM) tool. Initially conceived by the network engineering team at
[DigitalOcean](https://www.digitalocean.com/), NetBox was developed specifically
to address the needs of network and infrastructure engineers.

NetBox runs as a web application atop the [Django](https://www.djangoproject.com/) Python framework with a [PostgreSQL](http://www.postgresql.org/) database. For a complete list of requirements, see `requirements.txt`. The code is available [on GitHub](https://github.com/digitalocean/netbox).
NetBox runs as a web application atop the [Django](https://www.djangoproject.com/)
Python framework with a [PostgreSQL](http://www.postgresql.org/) database. For a
complete list of requirements, see `requirements.txt`. The code is available [on GitHub](https://github.com/digitalocean/netbox).

The complete documentation for NetBox can be found at [Read the Docs](http://netbox.readthedocs.io/en/stable/).

Questions? Comments? Please subscribe to [the netbox-discuss mailing list](https://groups.google.com/forum/#!forum/netbox-discuss), or join us on IRC in **#netbox** on **irc.freenode.net**!
Questions? Comments? Please subscribe to [the netbox-discuss mailing list](https://groups.google.com/forum/#!forum/netbox-discuss),
or join us in the #netbox Slack channel on [NetworkToCode](https://slack.networktocode.com/)!

### Build Status

Expand All @@ -27,7 +33,9 @@ NetBox is built against both Python 2.7 and 3.5. Python 3.5 is recommended.

# Installation

Please see [the documentation](http://netbox.readthedocs.io/en/stable/) for instructions on installing NetBox. To upgrade NetBox, please download the [latest release](https://github.com/digitalocean/netbox/releases) and run `upgrade.sh`.
Please see [the documentation](http://netbox.readthedocs.io/en/stable/) for
instructions on installing NetBox. To upgrade NetBox, please download the [latest release](https://github.com/digitalocean/netbox/releases)
and run `upgrade.sh`.

## Alternative Installations

Expand Down
4 changes: 2 additions & 2 deletions docs/api/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Supported HTTP methods:
* `GET`: Retrieve an object or list of objects
* `POST`: Create a new object
* `PUT`: Update an existing object, all mandatory fields must be specified
* `PATCH`: Updates an existing object, only specifiying the field to be changed
* `PATCH`: Updates an existing object, only specifying the field to be changed
* `DELETE`: Delete an existing object

To authenticate a request, attach your token in an `Authorization` header:
Expand Down Expand Up @@ -144,4 +144,4 @@ $ curl -v -X DELETE -H "Authorization: Token d2f763479f703d80de0ec15254237bc651f
* Closing connection 0
```

The response to a successfull `DELETE` request will have code 204 (No Content); the body of the response will be empty.
The response to a successful `DELETE` request will have code 204 (No Content); the body of the response will be empty.
2 changes: 1 addition & 1 deletion docs/installation/ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ AUTH_LDAP_USER_ATTR_MAP = {
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType

# This search ought to return all groups to which the user belongs. django_auth_ldap uses this to determine group
# heirarchy.
# hierarchy.
AUTH_LDAP_GROUP_SEARCH = LDAPSearch("dc=example,dc=com", ldap.SCOPE_SUBTREE,
"(objectClass=group)")
AUTH_LDAP_GROUP_TYPE = GroupOfNamesType()
Expand Down
4 changes: 2 additions & 2 deletions docs/miscellaneous/shell.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NetBox includes a Python shell withing which objects can be directly queried, created, modified, and deleted. To enter the shell, run the following command:
NetBox includes a Python shell within which objects can be directly queried, created, modified, and deleted. To enter the shell, run the following command:

```
./manage.py nbshell
Expand Down Expand Up @@ -86,7 +86,7 @@ The `count()` method can be appended to the queryset to return a count of object
982
```

Relationships with other models can be traversed by concatenting field names with a double-underscore. For example, the following will return all devices assigned to the tenant named "Pied Piper."
Relationships with other models can be traversed by concatenating field names with a double-underscore. For example, the following will return all devices assigned to the tenant named "Pied Piper."

```
>>> Device.objects.filter(tenant__name='Pied Piper')
Expand Down
4 changes: 2 additions & 2 deletions netbox/circuits/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProviderCSVForm(forms.ModelForm):

class Meta:
model = Provider
fields = ['name', 'slug', 'asn', 'account', 'portal_url', 'comments']
fields = Provider.csv_headers
help_texts = {
'name': 'Provider name',
'asn': '32-bit autonomous system number',
Expand Down Expand Up @@ -89,7 +89,7 @@ class CircuitTypeCSVForm(forms.ModelForm):

class Meta:
model = CircuitType
fields = ['name', 'slug']
fields = CircuitType.csv_headers
help_texts = {
'name': 'Name of circuit type',
}
Expand Down
27 changes: 19 additions & 8 deletions netbox/circuits/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from extras.models import CustomFieldModel, CustomFieldValue
from tenancy.models import Tenant
from utilities.models import CreatedUpdatedModel
from utilities.utils import csv_format
from .constants import *


Expand All @@ -29,7 +28,7 @@ class Provider(CreatedUpdatedModel, CustomFieldModel):
comments = models.TextField(blank=True)
custom_field_values = GenericRelation(CustomFieldValue, content_type_field='obj_type', object_id_field='obj_id')

csv_headers = ['name', 'slug', 'asn', 'account', 'portal_url']
csv_headers = ['name', 'slug', 'asn', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'comments']

class Meta:
ordering = ['name']
Expand All @@ -41,13 +40,16 @@ def get_absolute_url(self):
return reverse('circuits:provider', args=[self.slug])

def to_csv(self):
return csv_format([
return (
self.name,
self.slug,
self.asn,
self.account,
self.portal_url,
])
self.noc_contact,
self.admin_contact,
self.comments,
)


@python_2_unicode_compatible
Expand All @@ -59,6 +61,8 @@ class CircuitType(models.Model):
name = models.CharField(max_length=50, unique=True)
slug = models.SlugField(unique=True)

csv_headers = ['name', 'slug']

class Meta:
ordering = ['name']

Expand All @@ -68,6 +72,12 @@ def __str__(self):
def get_absolute_url(self):
return "{}?type={}".format(reverse('circuits:circuit_list'), self.slug)

def to_csv(self):
return (
self.name,
self.slug,
)


@python_2_unicode_compatible
class Circuit(CreatedUpdatedModel, CustomFieldModel):
Expand All @@ -86,7 +96,7 @@ class Circuit(CreatedUpdatedModel, CustomFieldModel):
comments = models.TextField(blank=True)
custom_field_values = GenericRelation(CustomFieldValue, content_type_field='obj_type', object_id_field='obj_id')

csv_headers = ['cid', 'provider', 'type', 'tenant', 'install_date', 'commit_rate', 'description']
csv_headers = ['cid', 'provider', 'type', 'tenant', 'install_date', 'commit_rate', 'description', 'comments']

class Meta:
ordering = ['provider', 'cid']
Expand All @@ -99,15 +109,16 @@ def get_absolute_url(self):
return reverse('circuits:circuit', args=[self.pk])

def to_csv(self):
return csv_format([
return (
self.cid,
self.provider.name,
self.type.name,
self.tenant.name if self.tenant else None,
self.install_date.isoformat() if self.install_date else None,
self.install_date,
self.commit_rate,
self.description,
])
self.comments,
)

def _get_termination(self, side):
for ct in self.terminations.all():
Expand Down
Loading

0 comments on commit c4f7e81

Please sign in to comment.