]>
git.proxmox.com Git - pve-common.git/log
Dietmar Maurer [Thu, 26 Nov 2015 07:09:44 +0000 (08:09 +0100)]
bump version to 4.0-39
Wolfgang Link [Wed, 25 Nov 2015 09:18:17 +0000 (10:18 +0100)]
add function file_copy
to have a save copy.
Dietmar Maurer [Thu, 19 Nov 2015 05:25:36 +0000 (06:25 +0100)]
bump version to 4.0-38
Dietmar Maurer [Thu, 19 Nov 2015 05:23:12 +0000 (06:23 +0100)]
avoid access to undefinded var $tag
Dietmar Maurer [Fri, 13 Nov 2015 10:16:48 +0000 (11:16 +0100)]
bump version to 4.0-37
Wolfgang Bumiller [Thu, 12 Nov 2015 10:23:39 +0000 (11:23 +0100)]
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.
Dietmar Maurer [Fri, 30 Oct 2015 10:05:49 +0000 (11:05 +0100)]
update changelog
Wolfgang Bumiller [Fri, 30 Oct 2015 09:31:01 +0000 (10:31 +0100)]
fix CLONE constant declaration
Wolfgang Bumiller [Fri, 30 Oct 2015 09:31:00 +0000 (10:31 +0100)]
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.
Dietmar Maurer [Fri, 30 Oct 2015 06:04:08 +0000 (07:04 +0100)]
bump version to 4.0-36
Wolfgang Bumiller [Thu, 29 Oct 2015 13:56:58 +0000 (14:56 +0100)]
print_property_string: skip undefined values
Wolfgang Bumiller [Thu, 29 Oct 2015 13:16:59 +0000 (14:16 +0100)]
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.
Dietmar Maurer [Fri, 23 Oct 2015 11:08:22 +0000 (13:08 +0200)]
bump version to 4.0-35
Wolfgang Bumiller [Thu, 22 Oct 2015 13:45:24 +0000 (15:45 +0200)]
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.
Dietmar Maurer [Mon, 19 Oct 2015 09:14:35 +0000 (11:14 +0200)]
bump version to 4.0-34
Wolfgang Bumiller [Mon, 19 Oct 2015 08:50:23 +0000 (10:50 +0200)]
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.
Wolfgang Bumiller [Fri, 16 Oct 2015 13:53:49 +0000 (15:53 +0200)]
network: IP_from_cidr and is_ip_in_cidr helpers
Dietmar Maurer [Fri, 16 Oct 2015 07:54:07 +0000 (09:54 +0200)]
bump version to 4.0-33
Wolfgang Bumiller [Fri, 16 Oct 2015 07:28:07 +0000 (09:28 +0200)]
allow /32 ipv4 cidrs
Wolfgang Bumiller [Thu, 15 Oct 2015 10:35:18 +0000 (12:35 +0200)]
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
Dietmar Maurer [Thu, 15 Oct 2015 10:22:59 +0000 (12:22 +0200)]
bump version tio 4.0-32
Wolfgang Bumiller [Thu, 15 Oct 2015 10:12:31 +0000 (12:12 +0200)]
print_property_string: disk-size is a format, not a type
Dietmar Maurer [Fri, 9 Oct 2015 09:48:25 +0000 (11:48 +0200)]
random_ether_addr: code cleanups
Philipp Marek [Wed, 7 Oct 2015 09:09:00 +0000 (11:09 +0200)]
Shorter implementation of random_ether_addr().
Dietmar Maurer [Fri, 9 Oct 2015 06:43:54 +0000 (08:43 +0200)]
bump version to 4.0-31
Dietmar Maurer [Fri, 9 Oct 2015 06:38:37 +0000 (08:38 +0200)]
parse_property_string: add newline to error strings
to prevent perl from adding 'at line xxx'
Wolfgang Bumiller [Wed, 7 Oct 2015 08:42:17 +0000 (10:42 +0200)]
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
Dietmar Maurer [Wed, 7 Oct 2015 06:57:24 +0000 (08:57 +0200)]
bump version to 4.0-30
Dietmar Maurer [Wed, 7 Oct 2015 06:55:42 +0000 (08:55 +0200)]
api_clone_schema: use Clone::clone instead of Storable::dclone
This works with CODE refs like 'completion' helpers.
Dietmar Maurer [Wed, 7 Oct 2015 06:54:25 +0000 (08:54 +0200)]
depend on libclone-perl
Dietmar Maurer [Mon, 5 Oct 2015 10:32:13 +0000 (12:32 +0200)]
bump version to 4.0-29
Wolfgang Bumiller [Mon, 5 Oct 2015 07:30:57 +0000 (09:30 +0200)]
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.
Wolfgang Bumiller [Mon, 5 Oct 2015 07:30:56 +0000 (09:30 +0200)]
INotify::read_etc_resolv_conf: ipv6 support
Dietmar Maurer [Fri, 2 Oct 2015 11:42:53 +0000 (13:42 +0200)]
bump version to 4.0-28
Dietmar Maurer [Fri, 2 Oct 2015 11:41:15 +0000 (13:41 +0200)]
run_cli_handler: add no_init for lxc mount hook
Dietmar Maurer [Fri, 2 Oct 2015 09:30:11 +0000 (11:30 +0200)]
run_cli_handler: use paramenter name 'prepare' instead of 'preparefunc'
Dietmar Maurer [Fri, 2 Oct 2015 09:24:43 +0000 (11:24 +0200)]
run_cli_handler: test for unknown parameters
Dietmar Maurer [Fri, 2 Oct 2015 09:02:49 +0000 (11:02 +0200)]
print_simple_pod_manpage: fix test for "not initialized"
Dietmar Maurer [Fri, 2 Oct 2015 08:43:39 +0000 (10:43 +0200)]
bump version to 4.0-27
Dietmar Maurer [Fri, 2 Oct 2015 08:37:50 +0000 (10:37 +0200)]
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.
Dietmar Maurer [Thu, 1 Oct 2015 09:26:27 +0000 (11:26 +0200)]
bump version to 4.0-26
Wolfgang Bumiller [Thu, 1 Oct 2015 08:36:29 +0000 (10:36 +0200)]
added JSONSchema::print_property_string
This will be used to format comma-separated property list
strings.
Wolfgang Bumiller [Thu, 1 Oct 2015 08:36:28 +0000 (10:36 +0200)]
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.
Wolfgang Bumiller [Thu, 1 Oct 2015 08:36:27 +0000 (10:36 +0200)]
Added PVE::JSONSchema::parse_size/format_size
Wolfgang Bumiller [Thu, 1 Oct 2015 08:36:26 +0000 (10:36 +0200)]
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.
Dietmar Maurer [Fri, 25 Sep 2015 05:04:53 +0000 (07:04 +0200)]
bump version to 4.0-25
Alexandre Derumier [Tue, 22 Sep 2015 06:26:58 +0000 (08:26 +0200)]
read|write network interfaces : add support for vlan interfaces
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Wed, 23 Sep 2015 06:22:15 +0000 (08:22 +0200)]
bump version to 4.0-24
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:44 +0000 (13:45 +0200)]
PodParser: use generate_typetext
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:43 +0000 (13:45 +0200)]
JSONSchema::generate_typetext: default_key support
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:42 +0000 (13:45 +0200)]
JSONSchema: verify comma-separated property strings
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:41 +0000 (13:45 +0200)]
Added JSONSchema::parse_property_string
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:40 +0000 (13:45 +0200)]
generate_typetext: better handling of only-optional cases
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:39 +0000 (13:45 +0200)]
JSONSchema::generate_typetext: raw typetext support
Instead of a format_description which ends up in the
documentation as 'key=<$desc>', a typetext can now be used
for an as-is string. (Eg. for when the key isn't required,
like for volumes in mountpoints, typetext can be set to
[volume=]volume)
Wolfgang Bumiller [Mon, 21 Sep 2015 10:11:08 +0000 (12:11 +0200)]
JSONSchema: pve-ipv4/6-config and CIDR split
Split CIDR schema into CIDRv4 and CIDRv6 and added
pve-ipv4-config and pve-ipv6-config formats.
Wolfgang Bumiller [Mon, 21 Sep 2015 10:11:07 +0000 (12:11 +0200)]
JSONSchema::check_object_warn
A version of check_object that warns and returns true or
false.
Wolfgang Bumiller [Mon, 21 Sep 2015 10:11:05 +0000 (12:11 +0200)]
JSONSchema: format_description + generate_typetext
Helper to generate schema-based typetext properties for
comma separated list configuration strings (like -net0 and -ip)
using a 'format_description' schema property.
Dietmar Maurer [Mon, 21 Sep 2015 10:11:36 +0000 (12:11 +0200)]
bump version to 4.0-23
Stefan Priebe [Sat, 14 Feb 2015 08:41:50 +0000 (09:41 +0100)]
support QinQ / vlan stacking
Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
Dietmar Maurer [Sun, 20 Sep 2015 08:34:04 +0000 (10:34 +0200)]
SectionConfig: protect against newline injection
Dietmar Maurer [Sat, 19 Sep 2015 08:39:20 +0000 (10:39 +0200)]
print_bash_completion: handle special case passing $arg_param as string
Dietmar Maurer [Fri, 18 Sep 2015 06:51:09 +0000 (08:51 +0200)]
createSchema: include type property
Dietmar Maurer [Fri, 18 Sep 2015 06:37:48 +0000 (08:37 +0200)]
bug fix: PVE::Tools::split_args returns a reference
Dietmar Maurer [Fri, 18 Sep 2015 05:46:56 +0000 (07:46 +0200)]
pass whole command line to bash completion function
Dietmar Maurer [Fri, 18 Sep 2015 05:45:32 +0000 (07:45 +0200)]
print_bash_completion: correctly handle shell quoting
Dietmar Maurer [Fri, 18 Sep 2015 05:18:00 +0000 (07:18 +0200)]
fix SectionConfig updateSchema for classes without plugins.
Dietmar Maurer [Fri, 18 Sep 2015 05:14:43 +0000 (07:14 +0200)]
SectionConfig: fix createSchema
correctly compute required properties.
Dietmar Maurer [Thu, 17 Sep 2015 15:45:59 +0000 (17:45 +0200)]
updateSchema: code cleanup - avoid assigning same value multiple times
Wolfgang Bumiller [Thu, 17 Sep 2015 10:50:03 +0000 (12:50 +0200)]
Tools: add unshare system call
Including the important CLONE_* constants.
Emmanuel Kasper [Thu, 17 Sep 2015 10:11:09 +0000 (12:11 +0200)]
Allow top level devel domain name up to 63 characters in email adresses
This corrects the server side validation, and fixes the bug: https://bugzilla.proxmox.com/show_bug.cgi?id=716
Dietmar Maurer [Wed, 16 Sep 2015 08:51:29 +0000 (10:51 +0200)]
update changelog
Alexandre Derumier [Tue, 15 Sep 2015 09:13:28 +0000 (11:13 +0200)]
add bridge_vlan_aware
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Wed, 16 Sep 2015 07:11:48 +0000 (09:11 +0200)]
bump version to 4.0-22
Wolfgang Bumiller [Tue, 15 Sep 2015 08:01:33 +0000 (10:01 +0200)]
Tools::run_command: array of arrays special case
Passing an array of arrays to run_command will cause each
array to be treated like a command piped to the following
command. Each argument is shell-quoted unless its passed by
reference.
Wolfgang Bumiller [Tue, 15 Sep 2015 08:01:32 +0000 (10:01 +0200)]
document run_command
Dietmar Maurer [Tue, 15 Sep 2015 07:04:24 +0000 (09:04 +0200)]
bump version to 4.0-21
Dietmar Maurer [Tue, 15 Sep 2015 06:16:33 +0000 (08:16 +0200)]
CLIHandler: allow binaries with '-' in command name
We automatically replace '-' with '_' to get the class name (perl
class names may not contain '-').
Wolfgang Bumiller [Mon, 14 Sep 2015 08:52:30 +0000 (10:52 +0200)]
remove autostart property from bridge ports
Fixes #711
Dietmar Maurer [Wed, 9 Sep 2015 07:14:05 +0000 (09:14 +0200)]
bump version to 4.0-20
Dietmar Maurer [Wed, 9 Sep 2015 07:10:15 +0000 (09:10 +0200)]
avoid Exporter warning
Else we get the following warning:
Subroutine PVE::ProcFSTools::getcwd redefined at /usr/share/perl/5.20/Exporter.pm line 66.
at /usr/share/perl5/PVE/ProcFSTools.pm line 9.
Dietmar Maurer [Tue, 8 Sep 2015 05:17:08 +0000 (07:17 +0200)]
bump version to 4.0-19
Wolfgang Bumiller [Mon, 7 Sep 2015 10:09:27 +0000 (12:09 +0200)]
is_mounted: use realpath on the mountpoint
This will avoid problmes with symlinks as well as paths
containing ./, ../ or trailing slashes.
Dietmar Maurer [Fri, 4 Sep 2015 11:50:06 +0000 (13:50 +0200)]
add missing formatter property to method schema
Dietmar Maurer [Fri, 4 Sep 2015 10:32:44 +0000 (12:32 +0200)]
run_cli: skip environment init for PVE::Service::* classes
This is done by the daemon implementation instead.
Dietmar Maurer [Fri, 4 Sep 2015 09:09:27 +0000 (11:09 +0200)]
CLIHandler: add support for services (PVE::Daemon), rename run to run_cli
And improve bash completion.
Dietmar Maurer [Fri, 4 Sep 2015 07:39:50 +0000 (09:39 +0200)]
generate_pod_manpage: fix for 'simple' commands
Dietmar Maurer [Fri, 4 Sep 2015 06:52:57 +0000 (08:52 +0200)]
get_options: avoid warning for -list format
Dietmar Maurer [Fri, 4 Sep 2015 05:46:25 +0000 (07:46 +0200)]
handle_simple_cmd: code cleanups
Add support for 'simple' commands in generate_pod_manpage().
Dietmar Maurer [Fri, 4 Sep 2015 04:19:05 +0000 (06:19 +0200)]
CLIHandler: add helper to generate bash completion config
Dietmar Maurer [Thu, 3 Sep 2015 16:58:27 +0000 (18:58 +0200)]
add run() method to CLIHandler
we can reuse that code for several binaries.
Dietmar Maurer [Thu, 3 Sep 2015 13:12:03 +0000 (15:12 +0200)]
add helpers to verify API without starting the binary
In future, we want to have a separate PVE::CLI::$binname class
for each binary. We can then simply load that class to verify
the API:
use PVE::CLI::pct;
PVE::CLI::pct->verify_api();
or to generate the docs:
PVE::CLI::pct->generate_pod_manpage();
Wolfgang Bumiller [Wed, 2 Sep 2015 10:09:54 +0000 (12:09 +0200)]
remove + from getopt's prefix_pattern
Perl by default interprets + as a parameter prefix, which
means commands like `pct resize 103 rootfs +1G` error with
'Unknown option: 1g', we don't want that.
Wolfgang Link [Thu, 3 Sep 2015 06:52:16 +0000 (08:52 +0200)]
This function checks if a moutpoint is mounted
Dietmar Maurer [Thu, 3 Sep 2015 07:53:55 +0000 (09:53 +0200)]
new helper: read_proc_mounts
Dietmar Maurer [Wed, 2 Sep 2015 13:22:12 +0000 (15:22 +0200)]
add bash completion handler
Dietmar Maurer [Wed, 2 Sep 2015 11:31:17 +0000 (13:31 +0200)]
add new property to support bash completions
Dietmar Maurer [Tue, 1 Sep 2015 15:47:47 +0000 (17:47 +0200)]
bump version to 4.0-18
Wolfgang Bumiller [Tue, 1 Sep 2015 09:32:30 +0000 (11:32 +0200)]
added 'extra-args' CLI handling
added 'extra-args' standard option
added 'extra-args' handling to PVE::JSONSchema::get_options
untainting 'extra-args' separately in RESTHandler::handle
Dietmar Maurer [Fri, 28 Aug 2015 09:37:32 +0000 (11:37 +0200)]
bump version to 4.0-17
Wolfgang Bumiller [Wed, 26 Aug 2015 08:38:27 +0000 (10:38 +0200)]
Added PVE::Network::tcp_ping to replace Net::Ping
We use Net::Ping twice in pve-storage (once for ISCSIPlugin
and once in GlusterfsPlugin, both with the 'tcp' variant.),
but Net::Ping doesn't support IPv6.