Stefan Reiter
3bb8802a08
format: fix render_bytes with CLIFormatter
...
CLIFormatter passes in an options hash as a second paramter, which so
far was ignored. Now that we treat it as a precision parameter, check if
it is a hash and extract the option from it before using it.
Otherwise perl puts HASH(0x...) into the format and sprintf chokes.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-02-25 21:20:59 +01:00
Thomas Lamprecht
ef737f0b3c
net: ip from CIDR: sort result
...
this should not be a real problem yet, but the perl keys hash pseudo
random order was an issue way to often to bet on that..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-25 13:47:56 +01:00
Fabian Ebner
1e55a6cd22
network: get_local_ip_from_cidr: return unique IPs
...
to avoid erroring out when "multiple" addresses are configured on live
migration, when in fact it's the same IP multiple times.
Seems like the same problem for a caller in pve-cluster was fixed by checking
the uniqueness afterwards, see commit 266041169beb36c8892ca54265e2d91335307ffb
in pve-cluster. But there doesn't seem to be any caller relying on the current
behavior, and no additional information other than the addresses are returned,
so fix it here.
Reported here:
https://forum.proxmox.com/threads/live-migration-of-vms-via-full-mesh-network-could-not-get-ip-multiple-addresses-configured-on-local-node-for-network.84585/
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-02-25 12:30:24 +01:00
Thomas Lamprecht
3fae4d24a9
bump version to 6.3-4
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-19 15:50:29 +01:00
Stoiko Ivanov
eb6262a6b7
fix #3259 : always free certificate file after reading it
...
This commit mirrors e3c4007bc94956962c03da8c6853415d2fdf057c in
pve-cluster. The fix there got lost with a refactoring for reusing the
code here in pve-common in c92b771669e68a8b49906b8a0a68b533750567b0
Tested by repeadetly reading https://$pve-node:8006/nodes on a
virtual testcluster.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-02-19 15:35:36 +01:00
Thomas Lamprecht
dc00c0529d
procfs: whitespace/indendation cleanup
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-19 15:35:06 +01:00
Fabian Ebner
ff8d3b1d7a
register email-or-username format
...
To be used for the mailto vzdump parameter.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
2021-02-18 12:49:15 +01:00
Fabian Ebner
4c4bd1047c
sendmail: use more complete email regex and shellquote
...
Shellquote is needed for '~', and while it doesn't help with '-',
there should be no problem, because options are separated from mailto
since commit 216a3f4f13
.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
2021-02-18 12:49:12 +01:00
Thomas Lamprecht
af640684dc
bump version to 6.3-3
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-08 16:09:16 +01:00
Thomas Lamprecht
b82ddf5d99
cgroup: get_pressure_stat: handle v1 controller gracefully
...
and return the default zeroed $res in case we cannot get any path
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-08 16:04:32 +01:00
Thomas Lamprecht
eadfaabdae
use unified parser for pressure stats
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-08 16:03:35 +01:00
Alexandre Derumier
0bc3dac963
add get_pressure_stat
...
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2021-02-08 15:04:28 +01:00
Thomas Lamprecht
8fbb755cd6
format: drop unused JSONSchema module use
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-08 15:03:29 +01:00
Stefan Reiter
4997835b08
format: handle undef, 0, and decimals in render_duration
...
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-02-08 14:40:38 +01:00
Stefan Reiter
57b3385290
extract PVE::Format from PVE::CLIFormatter for reuse
...
and add some tests
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-02-08 14:40:38 +01:00
Fabian Ebner
4b32ef6e2c
SectionConfig: parse_config: add errors to result
...
so that callers can know about them. This is useful in places where we'd rather
abort then continue with a faulty configuration. For example, when reading the
storage configuration before executing a backup job.
Originally-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-21 15:48:16 +01:00
Thomas Lamprecht
ad3ec2bb7c
buildsys: use plain cp instead of rsync
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-14 19:54:48 +01:00
Thomas Lamprecht
f0bf7e9d6c
bump version to 6.3-2
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-03 16:53:22 +01:00
Thomas Lamprecht
9d52694bca
followup comment/code cleanups
...
actually explain why we set to undef and not use `delete`.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-03 16:51:33 +01:00
Dominik Csapak
40682a697d
tools: add extract_sensitive_params
...
moved and generalized from pve-storage, since we'll need it
in more places
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-12-03 16:46:16 +01:00
Dominik Csapak
5640c3db26
PBSClient: add get_repository to generate repository urls from configs
...
we can use this everywhere we need to have a repository url
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-12-03 16:39:21 +01:00
Thomas Lamprecht
83b0b7d185
buildsys: clean more
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-03 16:39:10 +01:00
Thomas Lamprecht
a8a8dd847b
bump version to 6.3-1
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-27 15:30:25 +01:00
Alexandre Derumier
9ca89b8722
Inotify: delete vlan-id for "iface.X" vlan iface.
...
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-11-27 15:26:25 +01:00
Thomas Lamprecht
63d0f1ff3e
subscription: use more specific machine repo definition for PVE/PMG
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-27 15:22:38 +01:00
Thomas Lamprecht
1d15203cfa
inotify: apt auth: sort longest machine entry first and allow deletion
...
plus a few code cleanups.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-27 15:21:40 +01:00
Thomas Lamprecht
7f4dcc9239
bump version to 6.2-6
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 16:22:25 +01:00
Thomas Lamprecht
dfc8643d65
rest: register method: allow minus in path template parameter names
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 16:20:54 +01:00
Thomas Lamprecht
a6766fedf3
rest: register method: non-capturing group for path regex outer group
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 16:20:15 +01:00
Thomas Lamprecht
76b0577cbd
bump version to 6.2-5
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 14:29:25 +01:00
Thomas Lamprecht
6674eb1e3d
PBS client: backup tree: avoid over generic param has
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:04:53 +01:00
Thomas Lamprecht
2113c7e8e9
PBS client: get snapshots: avoid over generic param has
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:04:43 +01:00
Thomas Lamprecht
69a3a5858f
PBS client: cannot use normal method call style for private subs
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:03:50 +01:00
Thomas Lamprecht
8b88b2f6e5
pbs: restore pxar: add required parameters explicitly in method signature
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:39:03 +01:00
Thomas Lamprecht
ad6b323758
pbs: code cleanup param array assembly
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:38:28 +01:00
Thomas Lamprecht
0cc6c7e01b
pbs: autogen key: adapt recent changes in storage module
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:12:31 +01:00
Thomas Lamprecht
243568ca26
PBS client: use our normal blessed method call style
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:12:02 +01:00
Stoiko Ivanov
0904f388a7
add PBSClient module
...
PBSClient.pm contains methods for:
* handling (sensitive) config-information (passwords, encryption keys)
* creating/restoring/forgetting/listing backups
code is mostly based on the current PBSPlugin in pve-storage
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-11-17 08:57:22 +01:00
Alexandre Derumier
39bf4956d4
systemd: add CPUWeight encoding
2020-11-06 09:31:11 +01:00
Alexandre Derumier
6d7c306596
bugfix: cpushares : default value is 1024 for cgroup v1
...
Currently if we delete cpuunit (undef), the default value is 100
2020-11-06 09:31:11 +01:00
Alexandre Derumier
9465abe251
Cgroups: remove specific lxc code
2020-11-06 09:31:11 +01:00
Alexandre Derumier
86dff11ce6
move PVE::LXC::CGroup to PVE::CGroup
2020-11-06 09:31:11 +01:00
Thomas Lamprecht
ad3e420bf0
bump version to 6.2-4
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-05 10:56:03 +01:00
Fabian Grünbichler
eeafe02d81
fix 3108: properly check IPv6 addr
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-02 08:33:51 +01:00
Stoiko Ivanov
e65624a3fa
Systemd: add helpers for parsing unit files
...
taken from pve-storage/PVE/API2/Disks/Directory.pm (and made available as
public sub)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-10-30 09:26:02 +01:00
Dominic Jäger
a8f9333441
Make configid regex public
...
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2020-10-29 15:20:40 +01:00
Dominic Jäger
e37d592413
Add tests for verify_configid
...
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2020-10-29 15:20:40 +01:00
Thomas Lamprecht
a7886364a7
sendmail: code cleanup
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-29 15:20:21 +01:00
Thomas Lamprecht
87ff065c98
network: fix conditional variable declaration
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-23 21:09:23 +02:00
Thomas Lamprecht
329dfb6488
network: cleanup "check bond" code
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-23 21:08:38 +02:00