Commit graph

270 commits

Author SHA1 Message Date
Christophe Simon
58775c0950 Added option to purge remaining devices
This patch adds an option to clear remaining devices in the context of a
new device replacing an old one with the same name but with a different
hardware.

The serial leading to the bug is described below:

- A first server is registered under name `A` with serial `X`
- A second server is registered under name `B` with serial `Y`
- The server with serial `X` is decomissionned, but not removed
- The server with serial `Y` is reinstalled with name `A`

In this case, a device with serial `X` is well found, and netbox agent
tries to update its name. But this raises an error because of the unique
constraint on name, as another device already holds this name.

The proposed solution to handle this situation is to delete any device
with same `name` but different `serial` before handling a device.

As this is not necessarily the expected behavior, it can be enabled by
using the `--purge-old-devices` to avoid breaking existing inventory.
2022-02-08 18:46:30 +01:00
Cyrinux
8a46af19b8
Fix a crash when missing rack id (#172) 2021-07-20 21:55:47 +02:00
ramnes
bdc450ef6a Make flake8 and isort happy 2021-07-09 11:10:43 +02:00
Cyril Levis
794f9787f0 NVME inventory fix.
The inventory crash with default nvme-cli version 1.8.1 on Centos7.
2021-07-09 11:00:41 +02:00
Solvik Blum
86527af1c0 lint 2021-05-18 13:59:04 +02:00
Solvik Blum
b738f4bfef fix last few bugs due to pynetbox 6 upgrade 2021-05-14 10:00:50 +02:00
Solvik Blum
aaea0a2477 fix ipv6 cleanup on interface with only one ipv6 and not ipv4 2021-05-12 20:11:20 +02:00
Solvik Blum
9eafcbf215 this MR will drop compatibility with versions < 2.9 2021-05-12 19:41:35 +02:00
Solvik Blum
95d7f98389 add new dependencies 2021-05-12 19:41:35 +02:00
Solvik Blum
576eb07dd7 make inventory compatible 2021-05-12 19:41:01 +02:00
Solvik Blum
337e272eea fix ipv6 deletion with regex 2021-05-12 19:41:01 +02:00
Solvik Blum
a1af028df6 last commit is based on pynetbox >= 6.1 2021-05-12 19:41:01 +02:00
Solvik Blum
58c18fc2da add more compatibility, now to netbox 2.10 2021-05-12 19:41:01 +02:00
Solvik Blum
3639662961 ignore tag update for Netbox version >= 2.8 2021-05-12 19:41:01 +02:00
Solvik Blum
1d98d3c8e9 fix ip association 2021-05-12 19:41:01 +02:00
Solvik Blum
dc582b5de6 change .interface foreignkey with .assigned_object 2021-05-12 19:41:01 +02:00
renovate[bot]
51efa8edba
Update dependency jsonargparse to v3 (#179)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-12 15:50:28 +02:00
Solvik
c4eb8f34ac
add 25G compatibility (#185) 2021-05-12 15:50:16 +02:00
renovate[bot]
7147670255
Update dependency pyyaml to v5.4.1 (#181)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-03-26 16:00:40 +01:00
Mark David
9e934af835
Remove an invalid character (#182)
Invalid character that causes some errors to throw if you're copying and pasting the config
2021-02-15 10:54:47 +01:00
Laurent Marchaud
2a1196b52d
Add support for Supermicro TwinPro devices (#180) 2020-12-18 17:23:37 +01:00
Solvik
77a84b365f
fix ugly supermicro blade support (#178) 2020-12-15 11:32:11 +01:00
Cyrinux
0f2cb531ae
Fix inventory crash on nvme binary too old or absent (#170)
* When nvme binary absent or too old and no json output, this crash the inventory, i prefer just pass nvme inventory and continue

* log if nvme-cli is not installed
2020-10-14 12:40:19 +02:00
Cyrinux
00653628c6
Truncate GPU product name to 50 characteres. (#169)
Example: Hi1710 [iBMC Intelligent Management system chip w/VGA support]
This product is too long, the api want max_length = 50 ...
2020-10-14 12:39:57 +02:00
Cyrinux
7999244096
Check if lldpctl present, and log debug if no lldpctl output. (#171) 2020-10-14 12:39:40 +02:00
Cyrinux
137728be1f
Add "ProLiant BL460c Gen10 Graphics Exp" support and GPU expansion bay (#165)
* Add "ProLiant BL460c Gen10 Graphics Exp"

* Add GPU expansion support for HP_ProLiant_BL460c_Gen10_Graphics_Exp

* Add ProLiant BL460c Graphics Expansion Blade support in README

* Dont crash if vendor other than HP

* Typo
2020-09-18 12:29:17 +02:00
Cyrinux
0fe17c9687
Add GPU inventory support (#164)
* Add GPU support

* Some update in the doc
2020-09-18 12:29:05 +02:00
Anton A. Grishin
28955612be
fix allocated_draw for inactive PSU (#168)
Co-authored-by: Anton Grishyn <grishin@maxpay.com>
2020-09-07 14:20:32 +02:00
Solvik Blum
fc930b9ef4 bump version 2020-08-24 13:45:18 +02:00
Cyrinux
e20e6a7dee
Fix travis (#162) 2020-08-24 12:52:25 +02:00
Cyrinux
e95a66d93a
Add HP Moonshot 1500 support (#161)
* Add HP Moonshot 1500 support
2020-08-20 18:03:36 +02:00
Solvik
feab0f1a58
Merge pull request #158 from Solvik/157
fix agent crash on server creation if not blade
2020-08-05 15:16:45 +02:00
Solvik
0a903596dc
Merge pull request #148 from Solvik/renovate/pynetbox-5.x
Update dependency pynetbox to v5.0.5
2020-07-29 00:54:36 +02:00
Renovate Bot
3aea4fbc3b
Update dependency pynetbox to v5.0.5 2020-07-28 22:50:26 +00:00
Solvik
54526d3d0b
Merge pull request #146 from Solvik/renovate/netaddr-0.x
Update dependency netaddr to v0.8.0
2020-07-29 00:49:54 +02:00
Solvik
a866e20548
Merge pull request #156 from Solvik/renovate/jsonargparse-2.x
Update dependency jsonargparse to v2.32.2
2020-07-29 00:48:33 +02:00
Solvik Blum
f8c0732c2b fix agent crash on server creation if not blade 2020-07-29 00:45:24 +02:00
Solvik
a59690469b
Merge pull request #155 from Solvik/supermicro
Fix Supermicro vendor class
2020-07-29 00:26:52 +02:00
Solvik
da5e8ad2e7
Update server.py 2020-07-29 00:21:08 +02:00
Renovate Bot
df18f6ea00
Update dependency netaddr to v0.8.0 2020-07-28 16:54:48 +00:00
Renovate Bot
4f0db3478f
Update dependency jsonargparse to v2.32.2 2020-07-28 16:54:34 +00:00
Solvik Blum
d1a0ec2324 fix unused import and add QCT test 2020-07-28 18:51:15 +02:00
Solvik Blum
e6472c623d update README.md to change the datacenter example to use a lowercase slug 2020-07-28 18:46:38 +02:00
Solvik
1685ecab16 Update issue templates 2020-07-19 11:32:32 +02:00
Solvik Blum
18e3480574 fix supermicro dmidecode parsing 2020-07-13 21:04:45 +02:00
Solvik Blum
839d9a908c better handling supermicro products (blade or not blade) 2020-07-11 15:56:10 +02:00
Solvik
875ad5c92e
Merge pull request #153 from Solvik/renovate/jsonargparse-2.x
Update dependency jsonargparse to v2.31.2
2020-07-11 15:53:49 +02:00
Solvik
ebee42bb48
Update README.md 2020-07-11 15:51:26 +02:00
Solvik Blum
70146b8614 fix not passing tenant when tenants exist in Netbox 2020-07-11 15:33:34 +02:00
Solvik
f936aeb717
Adding the --netbox.ssl_verify option (#152) 2020-07-11 15:32:00 +02:00