5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-24 14:03:35 +03:00

377 Commits

Author SHA1 Message Date
Wolfgang Bumiller
35e7d23983 print_property_string: skip keys early
Keys in the skip-list don't need to be valid schema keys.
This was overly strict before which makes it harder to
include temporary internal keys in a such an object.
2015-11-26 12:10:48 +01:00
Dietmar Maurer
dca615d2e8 bump version to 4.0-39 2015-11-26 08:09:44 +01:00
Wolfgang Link
23e0e0d786 add function file_copy
to have a save copy.
2015-11-26 08:08:31 +01:00
Dietmar Maurer
015b013080 bump version to 4.0-38 2015-11-19 06:25:36 +01:00
Dietmar Maurer
34eb365639 avoid access to undefinded var $tag 2015-11-19 06:23:12 +01:00
Dietmar Maurer
87432734f6 bump version to 4.0-37 2015-11-13 11:16:48 +01:00
Wolfgang Bumiller
072dfa92a5 ProcFSTools: implement conforming parse_mounts
There are a few places where we grep over /proc/mounts
without taking the encoding into acount.
ProcFSTools::parse_mounts parses mount data and decodes all
the special character the kernel might encode into it.

Shortcut: parse_proc_mounts to do
parse_mounts(read_proc_mounts()).
is_mounted() updated to parse mounts correctly.
2015-11-13 11:16:13 +01:00
Dietmar Maurer
c8ae5c7e9c update changelog 2015-10-30 11:05:49 +01:00
Wolfgang Bumiller
be8f0477bc fix CLONE constant declaration 2015-10-30 11:04:51 +01:00
Wolfgang Bumiller
817c6be02c Tools: make unshare behave like other perl syscalls
Most syscall wrappers in perl return 1 on success and our
current use of Tools::unshare isn't using the return value
(yet), so let's fix this while we can.

Also it seems to make sense to use prototyping on syscalls
to add some compile-time argument checking.
2015-10-30 11:03:55 +01:00
Dietmar Maurer
9de823bdc3 bump version to 4.0-36 2015-10-30 07:04:08 +01:00
Wolfgang Bumiller
20b69017a8 print_property_string: skip undefined values 2015-10-30 07:03:10 +01:00
Wolfgang Bumiller
97c8c8577d Tools::df: fork and use Filesys::Df
Instead of depending on the 'df' commandline tool do a
fork() to create a killable process and run Filesys::Df,
returning the data over a pipe.
2015-10-30 07:00:37 +01:00
Dietmar Maurer
d8ade58f3a bump version to 4.0-35 2015-10-23 13:08:22 +02:00
Wolfgang Bumiller
ef67212cf2 read_prox_net_ipv6_route fixup
- read_v6addr used the wrong $_
- All values in the file are hex and possibly prefixed with
zeroes so we need to make sure they don't get interpreted as
octal.
2015-10-23 12:13:35 +02:00
Dietmar Maurer
87ffaecbfb bump version to 4.0-34 2015-10-19 11:14:35 +02:00
Wolfgang Bumiller
aeac55e138 half-revert: remove autostart property from bridge ports
In commit 21d32c95cd autostart was removed from all bridge
ports but should have only been removed from ovs bridge ports.
2015-10-19 11:11:29 +02:00
Wolfgang Bumiller
bf52d27bb3 network: IP_from_cidr and is_ip_in_cidr helpers 2015-10-16 16:51:01 +02:00
Dietmar Maurer
da6362722d bump version to 4.0-33 2015-10-16 09:54:07 +02:00
Wolfgang Bumiller
0526cc2d79 allow /32 ipv4 cidrs 2015-10-16 09:52:26 +02:00
Wolfgang Bumiller
303a9b34ea support aliases in property strings
In qemu the 'volume' key maps to 'file', both can be used,
so to support this case in the comma-separated property
list parser we need a way to alias keys to one another.
This allows declaring a key like:

  volume => {
      alias => 'file'
  }
  file => {
      type => 'string',
      format => 'pve-volume-id',
      default_key => 1,
      format_description => 'volume'
  }

With this the following property strings are equivalent and
result in the same datastructure being returned from
parse_property_string:

  local:disk.raw
  file=local:disk.raw
  volume=local:disk.raw
2015-10-15 12:36:07 +02:00
Dietmar Maurer
df0c6a7cd8 bump version tio 4.0-32 2015-10-15 12:22:59 +02:00
Wolfgang Bumiller
5f3f697dcd print_property_string: disk-size is a format, not a type 2015-10-15 12:20:50 +02:00
Dietmar Maurer
85d5625a15 random_ether_addr: code cleanups 2015-10-09 11:48:25 +02:00
Philipp Marek
de9a267fec Shorter implementation of random_ether_addr(). 2015-10-09 11:46:50 +02:00
Dietmar Maurer
e88f9c631c bump version to 4.0-31 2015-10-09 08:43:54 +02:00
Dietmar Maurer
2d468b1aa2 parse_property_string: add newline to error strings
to prevent perl from adding 'at line xxx'
2015-10-09 08:38:37 +02:00
Wolfgang Bumiller
7a82210017 don't reorder unknown interface types
Giving unknown interfaces an order-id of 0 caused them to
always be on top of the interfaces file. This is often
undesired. Instead we now only take type-ordering into
account when both interfaces which are being compared have a
known type, and otherwise only use the priority attribute.
This should result in a more stable modification of
interfaces.

Fixes #747
2015-10-07 13:43:28 +02:00
Dietmar Maurer
d6d19fac6b bump version to 4.0-30 2015-10-07 08:57:24 +02:00
Dietmar Maurer
4be9b5f7de api_clone_schema: use Clone::clone instead of Storable::dclone
This works with CODE refs like 'completion' helpers.
2015-10-07 08:55:42 +02:00
Dietmar Maurer
051d9b42a8 depend on libclone-perl 2015-10-07 08:54:25 +02:00
Dietmar Maurer
3a12295c00 bump version to 4.0-29 2015-10-05 12:32:13 +02:00
Wolfgang Bumiller
cd9bd2526a Tools::IPV4OCTET: move longer alternatives forward
In an alternation /a|b|c/ the first match matches, so while
'1.1.1.121' matches /^$IPV4RE$/ (note the ^ and $ anchors),
parsing a line like /nameserver ($IPV4RE)/ would only
extract '1.1.1.12', ignoring the last '1' due to the /[1-9]/
alternative matching before the /1[0-9]/ one.
2015-10-05 12:31:24 +02:00
Wolfgang Bumiller
176b1186bd INotify::read_etc_resolv_conf: ipv6 support 2015-10-05 12:30:44 +02:00
Dietmar Maurer
027e1e4e39 bump version to 4.0-28 2015-10-02 13:42:53 +02:00
Dietmar Maurer
5ffbe2f10a run_cli_handler: add no_init for lxc mount hook 2015-10-02 13:41:15 +02:00
Dietmar Maurer
5ae87c41eb run_cli_handler: use paramenter name 'prepare' instead of 'preparefunc' 2015-10-02 11:31:43 +02:00
Dietmar Maurer
aa9b9af5a8 run_cli_handler: test for unknown parameters 2015-10-02 11:24:43 +02:00
Dietmar Maurer
2fff84d929 print_simple_pod_manpage: fix test for "not initialized" 2015-10-02 11:02:49 +02:00
Dietmar Maurer
9fa98bfa20 bump version to 4.0-27 2015-10-02 10:43:39 +02:00
Dietmar Maurer
891b798d52 CLIHandler: make read_password an optional class method
And correctly hide password option when generation man pages.
I also define a new method run_cli_handler() meant to replace
the old run_cli() code, using named parameters.
2015-10-02 10:37:50 +02:00
Dietmar Maurer
820e360148 bump version to 4.0-26 2015-10-01 11:26:27 +02:00
Wolfgang Bumiller
94dd443532 added JSONSchema::print_property_string
This will be used to format comma-separated property list
strings.
2015-10-01 11:24:24 +02:00
Wolfgang Bumiller
b944a22a6d JSONSchema: added disk-size format
It's a special case in some output functions as it needs
to use format_size(), so it'll be its own type and handled
in the upcoming print_property_string() function.
2015-10-01 11:24:00 +02:00
Wolfgang Bumiller
878fea8ef0 Added PVE::JSONSchema::parse_size/format_size 2015-10-01 11:23:21 +02:00
Wolfgang Bumiller
2421fba133 Support named formats in typetext generation
Now that generate_typetext doesn't need to be accessed
anymore it made sense to move it to PodParser.pm as this is
the only place that uses it now.
PodParser now needs access to JSONSchema's $format_list, so
a JSONSchema::get_format was added.
2015-10-01 11:22:39 +02:00
Dietmar Maurer
2f53cc3919 bump version to 4.0-25 2015-09-25 07:04:53 +02:00
Alexandre Derumier
9c8089450c read|write network interfaces : add support for vlan interfaces
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-25 06:57:24 +02:00
Dietmar Maurer
42b8a14812 bump version to 4.0-24 2015-09-23 08:22:15 +02:00
Wolfgang Bumiller
990b6a1a5b PodParser: use generate_typetext 2015-09-23 08:11:10 +02:00