]> git.proxmox.com Git - pve-common.git/log
pve-common.git
8 years agobump version to 4.0-28
Dietmar Maurer [Fri, 2 Oct 2015 11:42:53 +0000 (13:42 +0200)]
bump version to 4.0-28

8 years agorun_cli_handler: add no_init for lxc mount hook
Dietmar Maurer [Fri, 2 Oct 2015 11:41:15 +0000 (13:41 +0200)]
run_cli_handler: add no_init for lxc mount hook

8 years agorun_cli_handler: use paramenter name 'prepare' instead of 'preparefunc'
Dietmar Maurer [Fri, 2 Oct 2015 09:30:11 +0000 (11:30 +0200)]
run_cli_handler: use paramenter name 'prepare' instead of 'preparefunc'

8 years agorun_cli_handler: test for unknown parameters
Dietmar Maurer [Fri, 2 Oct 2015 09:24:43 +0000 (11:24 +0200)]
run_cli_handler: test for unknown parameters

8 years agoprint_simple_pod_manpage: fix test for "not initialized"
Dietmar Maurer [Fri, 2 Oct 2015 09:02:49 +0000 (11:02 +0200)]
print_simple_pod_manpage: fix test for "not initialized"

8 years agobump version to 4.0-27
Dietmar Maurer [Fri, 2 Oct 2015 08:43:39 +0000 (10:43 +0200)]
bump version to 4.0-27

8 years agoCLIHandler: make read_password an optional class method
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.

8 years agobump version to 4.0-26
Dietmar Maurer [Thu, 1 Oct 2015 09:26:27 +0000 (11:26 +0200)]
bump version to 4.0-26

8 years agoadded JSONSchema::print_property_string
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.

8 years agoJSONSchema: added disk-size format
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.

8 years agoAdded PVE::JSONSchema::parse_size/format_size
Wolfgang Bumiller [Thu, 1 Oct 2015 08:36:27 +0000 (10:36 +0200)]
Added PVE::JSONSchema::parse_size/format_size

8 years agoSupport named formats in typetext generation
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.

8 years agobump version to 4.0-25
Dietmar Maurer [Fri, 25 Sep 2015 05:04:53 +0000 (07:04 +0200)]
bump version to 4.0-25

8 years agoread|write network interfaces : add support for vlan interfaces
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>
8 years agobump version to 4.0-24
Dietmar Maurer [Wed, 23 Sep 2015 06:22:15 +0000 (08:22 +0200)]
bump version to 4.0-24

8 years agoPodParser: use generate_typetext
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:44 +0000 (13:45 +0200)]
PodParser: use generate_typetext

8 years agoJSONSchema::generate_typetext: default_key support
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:43 +0000 (13:45 +0200)]
JSONSchema::generate_typetext: default_key support

8 years agoJSONSchema: verify comma-separated property strings
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:42 +0000 (13:45 +0200)]
JSONSchema: verify comma-separated property strings

8 years agoAdded JSONSchema::parse_property_string
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:41 +0000 (13:45 +0200)]
Added JSONSchema::parse_property_string

8 years agogenerate_typetext: better handling of only-optional cases
Wolfgang Bumiller [Tue, 22 Sep 2015 11:45:40 +0000 (13:45 +0200)]
generate_typetext: better handling of only-optional cases

8 years agoJSONSchema::generate_typetext: raw typetext support
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)

8 years agoJSONSchema: pve-ipv4/6-config and CIDR split
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.

8 years agoJSONSchema::check_object_warn
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.

8 years agoJSONSchema: format_description + generate_typetext
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.

8 years agobump version to 4.0-23
Dietmar Maurer [Mon, 21 Sep 2015 10:11:36 +0000 (12:11 +0200)]
bump version to 4.0-23

8 years agosupport QinQ / vlan stacking
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>
8 years agoSectionConfig: protect against newline injection
Dietmar Maurer [Sun, 20 Sep 2015 08:34:04 +0000 (10:34 +0200)]
SectionConfig: protect against newline injection

8 years agoprint_bash_completion: handle special case passing $arg_param as string
Dietmar Maurer [Sat, 19 Sep 2015 08:39:20 +0000 (10:39 +0200)]
print_bash_completion: handle special case passing $arg_param as string

8 years agocreateSchema: include type property
Dietmar Maurer [Fri, 18 Sep 2015 06:51:09 +0000 (08:51 +0200)]
createSchema: include type property

8 years agobug fix: PVE::Tools::split_args returns a reference
Dietmar Maurer [Fri, 18 Sep 2015 06:37:48 +0000 (08:37 +0200)]
bug fix: PVE::Tools::split_args returns a reference

8 years agopass whole command line to bash completion function
Dietmar Maurer [Fri, 18 Sep 2015 05:46:56 +0000 (07:46 +0200)]
pass whole command line to bash completion function

8 years agoprint_bash_completion: correctly handle shell quoting
Dietmar Maurer [Fri, 18 Sep 2015 05:45:32 +0000 (07:45 +0200)]
print_bash_completion: correctly handle shell quoting

8 years agofix SectionConfig updateSchema for classes without plugins.
Dietmar Maurer [Fri, 18 Sep 2015 05:18:00 +0000 (07:18 +0200)]
fix SectionConfig updateSchema for classes without plugins.

8 years agoSectionConfig: fix createSchema
Dietmar Maurer [Fri, 18 Sep 2015 05:14:43 +0000 (07:14 +0200)]
SectionConfig: fix createSchema

correctly compute required properties.

8 years agoupdateSchema: code cleanup - avoid assigning same value multiple times
Dietmar Maurer [Thu, 17 Sep 2015 15:45:59 +0000 (17:45 +0200)]
updateSchema: code cleanup -  avoid assigning same value multiple times

8 years agoTools: add unshare system call
Wolfgang Bumiller [Thu, 17 Sep 2015 10:50:03 +0000 (12:50 +0200)]
Tools: add unshare system call

Including the important CLONE_* constants.

8 years agoAllow top level devel domain name up to 63 characters in email adresses
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

8 years agoupdate changelog
Dietmar Maurer [Wed, 16 Sep 2015 08:51:29 +0000 (10:51 +0200)]
update changelog

8 years agoadd bridge_vlan_aware
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>
8 years agobump version to 4.0-22
Dietmar Maurer [Wed, 16 Sep 2015 07:11:48 +0000 (09:11 +0200)]
bump version to 4.0-22

8 years agoTools::run_command: array of arrays special case
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.

8 years agodocument run_command
Wolfgang Bumiller [Tue, 15 Sep 2015 08:01:32 +0000 (10:01 +0200)]
document run_command

8 years agobump version to 4.0-21
Dietmar Maurer [Tue, 15 Sep 2015 07:04:24 +0000 (09:04 +0200)]
bump version to 4.0-21

8 years agoCLIHandler: allow binaries with '-' in command name
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 '-').

8 years agoremove autostart property from bridge ports
Wolfgang Bumiller [Mon, 14 Sep 2015 08:52:30 +0000 (10:52 +0200)]
remove autostart property from bridge ports

Fixes #711

8 years agobump version to 4.0-20
Dietmar Maurer [Wed, 9 Sep 2015 07:14:05 +0000 (09:14 +0200)]
bump version to 4.0-20

8 years agoavoid Exporter warning
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.

8 years agobump version to 4.0-19
Dietmar Maurer [Tue, 8 Sep 2015 05:17:08 +0000 (07:17 +0200)]
bump version to 4.0-19

8 years agois_mounted: use realpath on the mountpoint
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.

8 years agoadd missing formatter property to method schema
Dietmar Maurer [Fri, 4 Sep 2015 11:50:06 +0000 (13:50 +0200)]
add missing formatter property to method schema

8 years agorun_cli: skip environment init for PVE::Service::* classes
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.

8 years agoCLIHandler: add support for services (PVE::Daemon), rename run to run_cli
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.

8 years agogenerate_pod_manpage: fix for 'simple' commands
Dietmar Maurer [Fri, 4 Sep 2015 07:39:50 +0000 (09:39 +0200)]
generate_pod_manpage: fix for 'simple' commands

8 years agoget_options: avoid warning for -list format
Dietmar Maurer [Fri, 4 Sep 2015 06:52:57 +0000 (08:52 +0200)]
get_options: avoid warning for -list format

8 years agohandle_simple_cmd: code cleanups
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().

8 years agoCLIHandler: add helper to generate bash completion config
Dietmar Maurer [Fri, 4 Sep 2015 04:19:05 +0000 (06:19 +0200)]
CLIHandler: add helper to generate bash completion config

8 years agoadd run() method to CLIHandler
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.

8 years agoadd helpers to verify API without starting the binary
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();

8 years agoremove + from getopt's prefix_pattern
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.

8 years agoThis function checks if a moutpoint is mounted
Wolfgang Link [Thu, 3 Sep 2015 06:52:16 +0000 (08:52 +0200)]
This function checks if a moutpoint is mounted

8 years agonew helper: read_proc_mounts
Dietmar Maurer [Thu, 3 Sep 2015 07:53:55 +0000 (09:53 +0200)]
new helper: read_proc_mounts

8 years agoadd bash completion handler
Dietmar Maurer [Wed, 2 Sep 2015 13:22:12 +0000 (15:22 +0200)]
add bash completion handler

8 years agoadd new property to support bash completions
Dietmar Maurer [Wed, 2 Sep 2015 11:31:17 +0000 (13:31 +0200)]
add new property to support bash completions

8 years agobump version to 4.0-18
Dietmar Maurer [Tue, 1 Sep 2015 15:47:47 +0000 (17:47 +0200)]
bump version to 4.0-18

8 years agoadded 'extra-args' CLI handling
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

8 years agobump version to 4.0-17
Dietmar Maurer [Fri, 28 Aug 2015 09:37:32 +0000 (11:37 +0200)]
bump version to 4.0-17

8 years agoAdded PVE::Network::tcp_ping to replace Net::Ping
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.

8 years agoTools::run_with_timeout improvement + hires alarm
Wolfgang Bumiller [Wed, 26 Aug 2015 08:38:26 +0000 (10:38 +0200)]
Tools::run_with_timeout improvement + hires alarm

The following situations could lead to the 'unknown error':
1) As commented, when the alarm triggered after the first
signal handler was installed and before the new alarm was
installed. In this case the $signalcount was increased,
and worse: the original signal handler was never called.

2) When $code died, since the call itself wasn't in an eval
block, we'd leave the eval block containing the inner alarm
signal handler. Then there's a time window from leaving the
signal block (and with that restoring the first installed
only-counting signal-handler) and reaching the code to
restore the previous alarm where the counting alarm handler
could get triggered by our own alarm set before running
$code. In this case at least the the old alarm would be
restored, but we'd still trigger the 'unknown error'.

The new code starts off by suspending the original alarm
before installing any signal handler, then installing the
timeout handler inside the first eval block. The $code is
then run inside another eval block to make sure we reach the
alarm(0) statement before restoring the old signal handler
and alarm timeout.

8 years agoAdd generic parse_host_and_port function
Wolfgang Bumiller [Tue, 25 Aug 2015 09:00:06 +0000 (11:00 +0200)]
Add generic parse_host_and_port function

Added a generic function to split a host+port string to the
host and port part supporting the two most common ipv6
notations beside domains and ipv4: with brackets for the
address or a dot as port separator.

8 years agoUpdate prerequisites for development environment
Wolfgang Link [Tue, 18 Aug 2015 09:06:27 +0000 (11:06 +0200)]
Update prerequisites for development environment

8 years agobump version to 4.0-16
Dietmar Maurer [Mon, 17 Aug 2015 07:43:57 +0000 (09:43 +0200)]
bump version to 4.0-16

8 years agofix bug #860: fix the upload from a VM when it is restricted.
Wolfgang [Fri, 14 Aug 2015 09:42:42 +0000 (11:42 +0200)]
fix bug #860: fix the upload from a VM when it is restricted.

8 years agobump cversion to 4.0-15
Dietmar Maurer [Mon, 10 Aug 2015 07:06:39 +0000 (09:06 +0200)]
bump cversion to 4.0-15

8 years agotap device name parse fix
Alen Grizonic [Fri, 7 Aug 2015 12:56:29 +0000 (14:56 +0200)]
tap device name parse fix

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agobump version to 4.0-14
Dietmar Maurer [Tue, 4 Aug 2015 06:59:56 +0000 (08:59 +0200)]
bump version to 4.0-14

8 years agoget_standard_option: do not overwrite defaults when they evaluate to false
Dietmar Maurer [Tue, 4 Aug 2015 06:58:09 +0000 (08:58 +0200)]
get_standard_option: do not overwrite defaults when they evaluate to false

8 years agofix a typo pointed out by Immo Wetzel
Wolfgang Bumiller [Mon, 3 Aug 2015 08:23:46 +0000 (10:23 +0200)]
fix a typo pointed out by Immo Wetzel

8 years agobump version to 4.0-13
Dietmar Maurer [Mon, 3 Aug 2015 14:13:55 +0000 (16:13 +0200)]
bump version to 4.0-13

8 years agofix tap_plug with vlan for non aware vlan bridges
Alexandre Derumier [Mon, 3 Aug 2015 13:07:37 +0000 (15:07 +0200)]
fix tap_plug with vlan for non aware vlan bridges

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
8 years agobump version to 4.0-12
Dietmar Maurer [Thu, 30 Jul 2015 07:00:17 +0000 (09:00 +0200)]
bump version to 4.0-12

8 years agoreplace /sbin/vconfig with /sbin/ip call
Wolfgang Bumiller [Wed, 29 Jul 2015 08:17:20 +0000 (10:17 +0200)]
replace /sbin/vconfig with /sbin/ip call

8 years agotap_plug : add support for vlan aware linux bridge
Alexandre Derumier [Fri, 24 Jul 2015 11:52:59 +0000 (13:52 +0200)]
tap_plug : add support for vlan aware linux bridge

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
8 years agobump version to 4.0-11
Dietmar Maurer [Mon, 27 Jul 2015 11:12:42 +0000 (13:12 +0200)]
bump version to 4.0-11

8 years agoadd ProcFSTools::read_proc_net_ipv6_route
Wolfgang Bumiller [Mon, 6 Jul 2015 08:03:38 +0000 (10:03 +0200)]
add ProcFSTools::read_proc_net_ipv6_route

8 years agoPVE::Network: add some common constants
Wolfgang Bumiller [Thu, 9 Jul 2015 06:47:08 +0000 (08:47 +0200)]
PVE::Network: add some common constants

added ipv4_reverse_mask and ipv4_mask_hash_localnet as they
are used in several places.

8 years agovalidate error message (typo) corrected
Alen Grizonic [Tue, 14 Jul 2015 09:00:57 +0000 (11:00 +0200)]
validate error message (typo) corrected

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agoimprove parse_config in JSONSchema and SectionConfig
Wolfgang Bumiller [Wed, 15 Jul 2015 08:09:41 +0000 (10:09 +0200)]
improve parse_config in JSONSchema and SectionConfig

The old code used string substitution for every line of the
input string, while perl can also iterate over all matches
via the /g re modifier, and can turn ^ and $ to act as
beginning/end of line via the /m modifier.

Effectively allowing a "match over all lines" via a simple
while ($data =~ /^.*$/gm);

The situation is a little different in SectionConfig because
there's a nested loop invovled which doesn't work with /g.
For this there are two options and I chose the safer one by
simply doing a split on newlines first.
The alternative would be to open the data as a
filehandle-to-string and use <$fh> to read lines, however
I'd have to throw in an eval{} to be sure to close the
handle afterwards.

8 years agoadded missing install build prerequisites for development environment
Thomas Lamprecht [Thu, 2 Jul 2015 12:17:41 +0000 (14:17 +0200)]
added missing install build prerequisites for development environment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 4.0-10
Dietmar Maurer [Fri, 26 Jun 2015 09:51:24 +0000 (11:51 +0200)]
bump version to 4.0-10

8 years agoadd veth_delete
Alexandre Derumier [Thu, 25 Jun 2015 05:06:42 +0000 (07:06 +0200)]
add veth_delete

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
8 years agoadd veth_create
Alexandre Derumier [Thu, 25 Jun 2015 05:06:40 +0000 (07:06 +0200)]
add veth_create

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
8 years agobump version to 4.0-9
Dietmar Maurer [Fri, 26 Jun 2015 05:56:28 +0000 (07:56 +0200)]
bump version to 4.0-9

8 years agorun regression tests before building the package
Dietmar Maurer [Fri, 26 Jun 2015 05:54:48 +0000 (07:54 +0200)]
run regression tests before building the package

8 years agotests: list/create/update network interfaces
Wolfgang Bumiller [Thu, 25 Jun 2015 09:54:34 +0000 (11:54 +0200)]
tests: list/create/update network interfaces

8 years agowrite_network_interfaces: improved sorting
Wolfgang Bumiller [Thu, 25 Jun 2015 09:54:33 +0000 (11:54 +0200)]
write_network_interfaces: improved sorting

This way option line positions between interfaces can be
preserved.

8 years agoPVE::INotify::write_network_interfaces: readability
Wolfgang Bumiller [Thu, 25 Jun 2015 09:54:32 +0000 (11:54 +0200)]
PVE::INotify::write_network_interfaces: readability

8 years agoimporting etc_network_interfaces tests
Wolfgang Bumiller [Thu, 25 Jun 2015 09:54:31 +0000 (11:54 +0200)]
importing etc_network_interfaces tests

8 years ago/etc/network/interfaces: deal with OVS allow- lines
Wolfgang Bumiller [Thu, 25 Jun 2015 09:54:30 +0000 (11:54 +0200)]
/etc/network/interfaces: deal with OVS allow- lines

* __read_etc_interfaces:
Delete OVS ports from "allow-$OVS_BRIDGE" option lines in
order to prevent them from being duplicated or kept after
removing the port from the bridge.

* __write_etc_interfaces:
Deleting unused OVSPorts has the side effect of them not
being written out at all. If, however, they are
physical interfaces they'll reappear the next time the
configuration is read, because they're added from
/proc/net/dev.
Fix: if the deleted interface matches the same condition as
in read_etc_interfaces, readd it with the standard options:
{exists => 1, method => manual }
This is a purely aesthetical change in order to make sure a
write()->read()->write() chain doesn't produce two
different files each write().

8 years agoread_etc_interfaces: missing iface initialization
Wolfgang Bumiller [Thu, 25 Jun 2015 09:54:29 +0000 (11:54 +0200)]
read_etc_interfaces: missing iface initialization

If no 'auto' line was read the interface hash has to be
initialized.

8 years agoPVE::INotify: testable interface parser
Wolfgang Bumiller [Thu, 25 Jun 2015 09:54:28 +0000 (11:54 +0200)]
PVE::INotify: testable interface parser

read_etc_network_interfaces now opens all /proc files and
passes them as filehandles to the actual implementation
which is now is __read_etc_network_interfaces.

Similarly write_etc_network_interfaces now prints the
content string returned by the implementation now named
__write_etc_network_interfaces.

This way a testsuite can use the __* variants directly to
test the parser, passing its own versions of the /proc
files.