Commit Graph

24 Commits

Author SHA1 Message Date
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
Wolfgang Bumiller
751ffbdd03 JSONSchema::generate_typetext: default_key support 2015-09-23 08:10:46 +02:00
Wolfgang Bumiller
2f9e609a46 JSONSchema: verify comma-separated property strings 2015-09-23 08:08:43 +02:00
Wolfgang Bumiller
095b88fd51 Added JSONSchema::parse_property_string 2015-09-23 08:04:54 +02:00
Wolfgang Bumiller
40605176f3 generate_typetext: better handling of only-optional cases 2015-09-23 08:01:44 +02:00
Wolfgang Bumiller
8c2d3ca159 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)
2015-09-23 07:59:46 +02:00
Wolfgang Bumiller
703c1f8831 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.
2015-09-22 08:01:58 +02:00
Wolfgang Bumiller
86425a09da JSONSchema::check_object_warn
A version of check_object that warns and returns true or
false.
2015-09-22 08:01:48 +02:00
Wolfgang Bumiller
d5d10f8580 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.
2015-09-22 08:00:59 +02:00
Emmanuel Kasper
87cb0e6064 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
2015-09-17 12:56:48 +02:00
Dietmar Maurer
638edfd429 add missing formatter property to method schema 2015-09-04 13:50:06 +02:00
Dietmar Maurer
4347914633 get_options: avoid warning for -list format 2015-09-04 08:52:57 +02:00
Wolfgang Bumiller
1068aeb398 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.
2015-09-03 11:19:28 +02:00
Dietmar Maurer
7829989f5e add new property to support bash completions 2015-09-02 13:31:17 +02:00
Wolfgang Bumiller
5851be88ad 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
2015-09-01 17:46:04 +02:00
Dietmar Maurer
c38ac70fe0 get_standard_option: do not overwrite defaults when they evaluate to false 2015-08-04 08:58:09 +02:00
Wolfgang Bumiller
3c4d612a70 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.
2015-07-22 08:15:54 +02:00
Wolfgang Bumiller
d07b7084c4 spice-proxy format now uses new address format
spice-proxy used dns-name before which matches a combination of letters,
digits and dots, which happens to include ipv4 addresses but not ipv6
ones.
Since 'dns-name' sounds like it's only for names, I'm adding an address
format which is either a dns-name or an ip (including ipv6).
2015-05-27 15:32:11 +02:00
Dietmar Maurer
93276209cc fix typo 2015-04-23 09:14:48 +02:00
Dietmar Maurer
ed5880acdc add additional methods for IP address verification 2015-04-23 08:19:03 +02:00
Dietmar Maurer
c70c3bbc83 cleanup: remove unnecessary prefix 2015-04-22 10:08:37 +02:00
Dietmar Maurer
b0edd8e6d2 register new standard option pve-startup-order
We can use this for lxc and qemu.
2015-04-22 09:49:15 +02:00
Dietmar Maurer
3432ae0c5e improve error message 2015-04-03 08:10:23 +02:00
Dietmar Maurer
b51b16e6f5 rename data to src 2015-02-27 16:57:20 +01:00