]>
git.proxmox.com Git - pve-common.git/log
Thomas Lamprecht [Wed, 27 Jun 2018 09:23:25 +0000 (11:23 +0200)]
cli: print_text_table: default to autosort on
we more often want to sort by the leftmost valid column than not.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 26 Jun 2018 13:55:26 +0000 (15:55 +0200)]
cli: print_api_result: simplify props_to_print code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dietmar Maurer [Wed, 27 Jun 2018 08:50:11 +0000 (10:50 +0200)]
PVE::CLIHandler::print_text_table - cleanup, directly use json schema data
This way we can access all type information and can use that to sort
numeric columns correctly.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Wed, 27 Jun 2018 08:50:10 +0000 (10:50 +0200)]
PVE::CLIHandler::print_text_table - add option $sort_key
Now, we do not change the ordering by default.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Stoiko Ivanov [Tue, 26 Jun 2018 09:33:46 +0000 (11:33 +0200)]
PVE::CLIHandler::data_to_text: return '' for undef
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Dietmar Maurer [Mon, 25 Jun 2018 12:42:18 +0000 (14:42 +0200)]
PVE::CLIHandler::print_api_result - add $props_to_print parameter
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Stoiko Ivanov [Fri, 22 Jun 2018 18:21:08 +0000 (20:21 +0200)]
PVE::CLIHandler::print_api_list: update comment
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Stoiko Ivanov [Fri, 22 Jun 2018 18:21:07 +0000 (20:21 +0200)]
PVE::CLIHandler::print_api_list - use all occuring properties
print_api_list falls back to the union of all properties occuring in data, if
none are provided explicitly, and the API method contains no returns property.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Stoiko Ivanov [Fri, 22 Jun 2018 18:21:06 +0000 (20:21 +0200)]
PVE::CLIHandler::print_text_table - fix sorting
Sort only if at least one column contains no undefined values.
Sort according to the left-most such column.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Dietmar Maurer [Fri, 22 Jun 2018 05:37:09 +0000 (07:37 +0200)]
cleanup: rename $returninfo to $result_schema
Dietmar Maurer [Fri, 22 Jun 2018 05:18:41 +0000 (07:18 +0200)]
PVE::CLIHandler::print_api_list - improve format check
We can only print lists of objects.
Dietmar Maurer [Fri, 22 Jun 2018 05:14:04 +0000 (07:14 +0200)]
PVE::CLIHandler::print_api_list - reorder arguments
Move optional argument to the end.
Dietmar Maurer [Fri, 22 Jun 2018 05:12:42 +0000 (07:12 +0200)]
PVE::CLIHandler::print_api_list - allow to pass empty $props_to_print
Dietmar Maurer [Fri, 22 Jun 2018 05:05:23 +0000 (07:05 +0200)]
PVE::CLIHandler - new helper print_api_result
Allow to print complex object/array by simply converting them to JSON.
Note: Our API almost always return simply values.
Thomas Lamprecht [Wed, 20 Jun 2018 12:12:18 +0000 (14:12 +0200)]
cli: print table: remove only-once-used default variable
Stoiko Ivanov [Wed, 20 Jun 2018 11:28:36 +0000 (13:28 +0200)]
cli: print_text_table: ensure default is not undefined
Default to printing '', if no default is provided for a column.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Wolfgang Bumiller [Wed, 20 Jun 2018 08:27:08 +0000 (10:27 +0200)]
INotify: write network: don't duplicate bridge-vids
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Alexandre Derumier [Wed, 20 Jun 2018 05:36:57 +0000 (07:36 +0200)]
Inotify : write network config : remove allow- ovs with ifupdown2
Alexandre Derumier [Wed, 20 Jun 2018 05:36:56 +0000 (07:36 +0200)]
Inotify : write network config : add bridge-vids
default is 2-4094 if user don't have specified.
mandatory for ifupdown2 and compatible with
current promox ifupdown bridgevlanport script
Alexandre Derumier [Wed, 20 Jun 2018 05:36:55 +0000 (07:36 +0200)]
Inotify : write network config : use modern syntax for options
-replace options with '_' with '-'
-use 'bond-slaves' instead 'slaves'
Alexandre Derumier [Wed, 20 Jun 2018 05:36:54 +0000 (07:36 +0200)]
Inotify : read network config : allow alternative options names
Thomas Lamprecht [Tue, 19 Jun 2018 10:18:29 +0000 (12:18 +0200)]
fixup: don't standard mapping code in mid of cmd helpers
as it teared code which belongs together apart
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Fri, 15 Jun 2018 13:28:44 +0000 (15:28 +0200)]
CLIHandler: add standard mapping for password parameter
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 15 Jun 2018 13:28:43 +0000 (15:28 +0200)]
CLIHandler: add standard_mappings
so we can reuse often used parameter mappings
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 15 Jun 2018 13:28:42 +0000 (15:28 +0200)]
add the possibility to use a hash for parameter mapping
instead of writing:
['name', sub {...}, 'description', 1]
one can now use:
{
name => 'name',
func => sub { ... },
desc => 'desc',
interactive => 1,
}
which makes it more obvious what is what
(and allows later patches to easily override some things)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Thomas Lamprecht [Mon, 18 Jun 2018 10:31:50 +0000 (12:31 +0200)]
print_api_list: we only handle API results of type 'array'
...for now at least
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 18 Jun 2018 10:19:08 +0000 (12:19 +0200)]
improve and fix some whitespace errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 18 Jun 2018 09:55:40 +0000 (11:55 +0200)]
reword print_text_table and print_api_list documentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stoiko Ivanov [Mon, 18 Jun 2018 08:18:02 +0000 (10:18 +0200)]
add print_api_list, adapt handle_cmd
print_api_list takes an array of columns to print, the data, and the returns
definitions of the API, and prints the data by using print_text_table.
handle_cmd and handle_simple_cmd call the output sub with the returns definitons.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Stoiko Ivanov [Mon, 18 Jun 2018 08:18:01 +0000 (10:18 +0200)]
add print_text_table, print_entry to CLIHandler
These two function could serve as a generic output sub for various CLI
utilities
* print_text_table prints an array of objects in a tabular fashion,
the formating is passed as an array containg hashes with titles, maximal
lengths and default values. This way we can stay extensible, by adding other
keys to the formatting options
* print_entry prints out a single entry, handling array-refs as properties
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Stoiko Ivanov [Mon, 18 Jun 2018 08:18:00 +0000 (10:18 +0200)]
add print_width property to JSONSchema definition
used to define the maximal width of the respective column in the CLI
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Thomas Lamprecht [Mon, 18 Jun 2018 06:37:33 +0000 (08:37 +0200)]
buildsys: depend on check target instead of manual calling it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 18 Jun 2018 06:34:59 +0000 (08:34 +0200)]
buildsys: refactor distclean and clean target
remove the cleanup of the not produced ${PACKAGE}-*.tar.gz file.
This is here since the import from SVN, but is not needed since quite
a time.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 18 Jun 2018 06:32:24 +0000 (08:32 +0200)]
buildsys: introduce BUILDDIR variable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 18 Jun 2018 06:10:33 +0000 (08:10 +0200)]
buildsys: remove useless variable definitions
the used ones are in src/Makefile, so remove those left over, else
one could get confused why there on two places and why changes here
had no effect.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 15 Jun 2018 10:06:16 +0000 (12:06 +0200)]
bump version to 5.0-34
Thomas Lamprecht [Fri, 15 Jun 2018 10:02:08 +0000 (12:02 +0200)]
d/control: record that we now break qemu-server << 5.0-29
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 15 Jun 2018 09:57:42 +0000 (11:57 +0200)]
rename splitted out systemd module to 'Systemd'
see:
https://www.freedesktop.org/wiki/Software/systemd/#spelling
We keep the initial upercase 'S' as it's standard for perl module
and perl critic complains otherwise.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Wolfgang Bumiller [Fri, 15 Jun 2018 09:00:52 +0000 (11:00 +0200)]
add PVE::SystemD module
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Thu, 14 Jun 2018 08:10:03 +0000 (10:10 +0200)]
Perl::Cricit fixups
- fix variable declared in conditional statement
- add newlines to die/warn statements
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Thu, 14 Jun 2018 07:26:12 +0000 (09:26 +0200)]
bump version to 5.0-33
Dietmar Maurer [Thu, 14 Jun 2018 07:04:47 +0000 (09:04 +0200)]
fix regex quoting in $print_bash_completion
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Wolfgang Bumiller [Thu, 14 Jun 2018 07:02:46 +0000 (09:02 +0200)]
cli: use exists() for alias check
should be faster
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Wed, 13 Jun 2018 07:37:51 +0000 (09:37 +0200)]
cli: only show subcommand specific usage if command incomplete
before:
$ pveum acl
ERROR: incomplete command 'pveum acl'
USAGE: pveum <COMMAND> [ARGS] [OPTIONS]
pveum acl delete <path> --roles <string> [OPTIONS]
pveum acl modify <path> --roles <string> [OPTIONS]
pveum group add <groupid> [OPTIONS]
pveum group delete <groupid>
pveum group modify <groupid> [OPTIONS]
pveum role add <roleid> [OPTIONS]
pveum role delete <roleid>
pveum role modify <roleid> --privs <string> [OPTIONS]
pveum user add <userid> [OPTIONS]
pveum user delete <userid>
pveum user modify <userid> [OPTIONS]
pveum passwd <userid>
pveum ticket <username> [OPTIONS]
pveum help [<extra-args>] [OPTIONS]
after:
$ pveum acl
ERROR: incomplete command 'pveum acl'
USAGE: pveum <COMMAND> [ARGS] [OPTIONS]
pveum acl delete <path> --roles <string> [OPTIONS]
pveum acl modify <path> --roles <string> [OPTIONS]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 13 Jun 2018 07:37:50 +0000 (09:37 +0200)]
cli: filter out aliases when trying to expand command
we do not complete them in bash copletion either and their just there
for backward compatibillity, so filter them out.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 13 Jun 2018 06:30:35 +0000 (08:30 +0200)]
generate_usage_str: show short usage help for unknown commands
followup for previous commit to show the full short usage string for
the CLI tool in the case of an unknown command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dietmar Maurer [Wed, 13 Jun 2018 06:00:22 +0000 (08:00 +0200)]
generate_usage_str: do no generate help for unknown commands
Before:
...
USAGE: pvesm aaa zfsscan
With this patch applied:
no such command 'aaa'
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dominik Csapak [Tue, 12 Jun 2018 10:33:47 +0000 (12:33 +0200)]
add a generalized 'read and confirm password' sub
to use everywhere we read two passwords and compare them
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Tue, 12 Jun 2018 08:57:45 +0000 (10:57 +0200)]
CLIHandler.pm: fix command line completion for simple commands
You can simply test behavior using 'qmrestore' ...
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Mon, 11 Jun 2018 09:23:19 +0000 (11:23 +0200)]
api_dump: add $raw_dump options
Allow to return the original tree with all refs. We use this
with our new pveclient which needs the full api definition.
Keeping refs makes it possible to store the tree more efficiently.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Wolfgang Bumiller [Thu, 7 Jun 2018 09:59:02 +0000 (11:59 +0200)]
bash completion: complete fully specified command
This contains 2 functional changes:
First: resolve_cmd no longer keeps a hash of which arguments
were expanded. This information is not required and not used
properly: For one it would conflict if the same word
appeared twice in a longer subcommand, and secondly we lose
the information when recursing into an alias anyway. And
lastly, we do not support tab completing multiple parameters
simultaneously anyway (as in, `pveum u a<tab>` does not
become `pveum user add`).
So now we simply return the expanded version of the last
command or undef if it was unknown in place of the hash we
returned previously.
The second change is how we use the new returned value:
Previously if resolve_cmd() returned a new subcommand in
$def we skipped over finishing the last word. Of course, if
the command was already fully specified (but no space put
after it), we already considered it complete and returned
the new $def.
This condition can be detected as in this case the $prev
command equals the $cur command. (Additionally, the $cur
command is either '' (after the space) or also the $prev
command (before the space), but checking this would only be
required when the same word can actually appear multiple
times in a row in a sub command chain...)
This case now takes precedence over looking through the
nested $def, so that bash will put the space after a full
command which requires another subcommand to be added.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Thu, 7 Jun 2018 09:59:01 +0000 (11:59 +0200)]
cleanup: fix variable typo
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Wed, 6 Jun 2018 04:24:32 +0000 (06:24 +0200)]
fix getopt when invoking without arguments
Wolfgang Bumiller [Mon, 4 Jun 2018 08:39:34 +0000 (10:39 +0200)]
tools: unbless errors in run_fork_with_timeout
We cannot properly encode blessed objects as json, so
instead, we should stringify them. This happened for
instance if a VM's systemd scope wasn't cleaned up as we
got an error as a Net::DBus::Error object causing a
"malformed json string" error to appear instead of the
actual message.
Additionally, add a 'must_stringify' helper: The above error
object implements a '""' operator for stringification (as
all error should), but in theory that could die as well, in
which case we just return a generic error string we'll
hopefully never see...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Tue, 29 May 2018 06:28:29 +0000 (08:28 +0200)]
bump version to 5.0-32
Wolfgang Bumiller [Wed, 16 May 2018 06:54:55 +0000 (08:54 +0200)]
fix #1766: compare task starttime numerically
Not only because <=> is correct, but using 'cmp' also has
the side effect that it adds a string version to the
variable and the API's json output turns into a string as
well, and this only happens once a task has completed
(while it's an integer while it's still running...)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Fri, 18 May 2018 07:01:46 +0000 (09:01 +0200)]
api_dump_remove_refs: prepare API tree for use with to_json($tree)
We want to use this with the extractapi.pl helper (pve-docs, pve-api-client).
Thomas Lamprecht [Fri, 4 May 2018 10:57:25 +0000 (12:57 +0200)]
bump version to 5.0-31
Fabian Grünbichler [Thu, 19 Apr 2018 12:01:35 +0000 (14:01 +0200)]
build: install ACME files
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Fabian Grünbichler [Mon, 30 Apr 2018 10:14:54 +0000 (12:14 +0200)]
acme: add challenge plugins
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Fabian Grünbichler [Thu, 19 Apr 2018 12:01:33 +0000 (14:01 +0200)]
acme: add ACME library
this implements those parts of draft-ietf-acme-acme-09 which are needed
to use Let's Encrypt's v2 API.
(based on an internal implement for the Let's Encrypt v1 API)
Co-Authored-By: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Fabian Grünbichler [Thu, 19 Apr 2018 12:01:32 +0000 (14:01 +0200)]
add Certificate helper
general purpose certificate related helper functions
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Dietmar Maurer [Wed, 25 Apr 2018 08:29:58 +0000 (10:29 +0200)]
new helper PVE::Tools::du() - get disk usage
We simply call the external binary 'du', so that we can abort the command
when we run into a timeout.
Dominik Csapak [Tue, 24 Apr 2018 08:15:14 +0000 (10:15 +0200)]
untaint df return values
since we sometimes use their length in a format string for printf
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 23 Apr 2018 06:21:48 +0000 (08:21 +0200)]
README.dev: inkscape no longer needed, s/git-core/git/
Thomas Lamprecht [Mon, 23 Apr 2018 06:20:56 +0000 (08:20 +0200)]
README.dev: s/jessie/stretch
Dietmar Maurer [Thu, 5 Apr 2018 10:23:17 +0000 (12:23 +0200)]
use ssh -X for upload target
Thomas Lamprecht [Thu, 22 Mar 2018 08:09:50 +0000 (09:09 +0100)]
bump version to 5.0-30
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Wolfgang Bumiller [Mon, 12 Mar 2018 11:44:52 +0000 (12:44 +0100)]
pty: fix read_password prototype
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Mon, 12 Mar 2018 12:04:15 +0000 (13:04 +0100)]
cli: more generic interactive parameter definition
Instead of hardcoding 'password' as a special case in the
JSONSchema's getopt handling, extend the new parameter
mapping to allow defining a parameters as 'interactive'.
They also take an optional argument on the command line
directly.
This effectively deprecates the password special case which
should be replaced in pct/pveum/... and then dropped in
pve-common.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Fri, 9 Mar 2018 07:56:27 +0000 (08:56 +0100)]
bump version to 5.0-29
Thomas Lamprecht [Tue, 6 Mar 2018 08:08:11 +0000 (09:08 +0100)]
CLIHandler: fix command usage string generation
track our command string, i.e. everything which cannot be an argument
for a specific command, in resolve_cmd, as we go through the commando
definition there anyway and know if a ARGV element is part of the
command itself or its arguments.
Fixes a problem where a invalid command had all the passed parameter
attached in the resulting USAGE output.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Fabian Grünbichler [Wed, 28 Feb 2018 09:42:56 +0000 (10:42 +0100)]
fix #1682: handle relative years absolutely
the timegm(gmtime()) and timelocal(localtime(()) constructs are
problematic in the following case: - $last is such that $year gets set
to a two-digit value (e.g., the referred to timestamp is somewhere in
the range of 1900-1999) - the current date is such that the value of
$year gets interpreted wrongly (e.g., anything other than 1950).
the exact breakage depends on the actual current date AND value of
$last, since localtime/gmtime will interpret two-digit years as (perldoc
Time::Local):
[...] shorthand for years in the rolling "current century," defined
as 50 years on either side of the current year. Thus, today, in
1999, 0 would refer to 2000, and 45 to 2045, but 55 would refer to
1955. Twenty years from now, 55 would instead refer to 2055.
fix it by adding 1900 to force 4-digit $year values, as the localtime
documentation suggests.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Dietmar Maurer [Fri, 2 Mar 2018 11:37:23 +0000 (12:37 +0100)]
use better name for string_param_file_mapping (param_mapping).
But keep old one for compatibility.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Fri, 2 Mar 2018 11:37:22 +0000 (12:37 +0100)]
rename $can_read_pass to $read_password_func
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Fri, 2 Mar 2018 11:37:21 +0000 (12:37 +0100)]
rename $pwcallback to $read_password_func
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Fri, 2 Mar 2018 11:37:20 +0000 (12:37 +0100)]
rename $can_str_param_fmap to $param_mapping_func
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Fri, 2 Mar 2018 11:37:19 +0000 (12:37 +0100)]
rename $stringfilemap to $param_mapping_func
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Fri, 2 Mar 2018 11:37:18 +0000 (12:37 +0100)]
introduce compute_param_mapping_hash helper
This allows us to specify a arbitrary mapping func for any param.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Fabian Grünbichler [Mon, 19 Feb 2018 10:41:34 +0000 (11:41 +0100)]
bump version to 5.0-28
Wolfgang Bumiller [Wed, 7 Feb 2018 13:15:19 +0000 (14:15 +0100)]
replace brctl with iproute2 calls
And add a few helpers for the common cases.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Tue, 30 Jan 2018 12:20:06 +0000 (13:20 +0100)]
schema: add bwlimit standard option and format
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Mon, 29 Jan 2018 14:06:30 +0000 (15:06 +0100)]
schema: allow ipv6 prefix lengths up to 128
There's no technical reason for *us* to limit this to 120.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Mon, 29 Jan 2018 09:49:14 +0000 (10:49 +0100)]
net: remove flowid in traffic limit commands
We don't use them and iproute2 4.13.0 has an issue parsing
parameters after a policing description.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Wolfgang Bumiller [Mon, 22 Jan 2018 14:09:59 +0000 (15:09 +0100)]
bump version to 5.0-27
Now breaks qemu-server<<5.0-21
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Dietmar Maurer [Mon, 22 Jan 2018 11:12:41 +0000 (12:12 +0100)]
INotify.pm - new helper poll_changes
Useful to detect file changes.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Dietmar Maurer [Mon, 22 Jan 2018 11:12:40 +0000 (12:12 +0100)]
read_file: replace $versions->{$filename} with $cver
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Thomas Lamprecht [Mon, 22 Jan 2018 10:00:07 +0000 (11:00 +0100)]
CLIHandler: use resolved command definition
For sub commands we resolve the real $cmd, $def and its arguments,
thus we should also get the handler from the resolved $def, not the
global one.
No change for normal (consisting of only the first argument)
commands, for them $cmddef == $def.
This sneaked in in a respin/rebase of the series.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Wolfgang Bumiller [Thu, 18 Jan 2018 08:31:02 +0000 (09:31 +0100)]
bump version to 5.0-26
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Tue, 9 Jan 2018 12:25:33 +0000 (13:25 +0100)]
cli: document $cmddef structure
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Tue, 9 Jan 2018 12:25:32 +0000 (13:25 +0100)]
cli: allow to pass sub commands to help as array
Improves usabillity by allowing to pass a sub copmmand unquoted to
the help command, e.g.:
# pveum help user delete
without this only a quoted version worked, e.g.:
# pveum help "user delete"
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Tue, 9 Jan 2018 12:25:31 +0000 (13:25 +0100)]
cli: allow specifying sub commands through $cmddef
allow to use sub commands alá
# pveum user add
The new resolve_cmd traverses $cmddef, resolves one level of aliases
and returns the respective sub command, its cmddef, arguments and if
it was expanded (e.g., pveum u d ... => pveum user delete ...) which
allows quite easy integration in the usage/synopsis generator, bash
completion helper and command handler.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 9 Jan 2018 12:25:30 +0000 (13:25 +0100)]
cli: factor out generate usage string
reduce code reuse and prepare for sub commands
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 9 Jan 2018 12:25:29 +0000 (13:25 +0100)]
cli: refactor print_bash_completion
move variables nearer to where they actually used.
drop program name early from argv array
drop unnecessary variables
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 8 Jan 2018 08:38:52 +0000 (09:38 +0100)]
JSONSchema: add fingerprint-sha256 standard option
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Wolfgang Bumiller [Wed, 27 Dec 2017 10:06:07 +0000 (11:06 +0100)]
fork_worker: guard more setup code with eval
As it might die with an error which should end up in the
_exit() code path rather than bailing out into the upper
scope.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Wolfgang Bumiller [Wed, 27 Dec 2017 10:11:05 +0000 (11:11 +0100)]
fork_worker: use correct handle type for POSIX::write
$resfh can be a pipe from POSIX::pipe() or the upid output
handle, which is an IO::File, so we need to take its
fileno().
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: ed52a8435a6d ("fork_worker: use separate pipe for status messages")
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Mon, 18 Dec 2017 09:21:39 +0000 (10:21 +0100)]
cli: factor out abort
will be reused in later patches too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Mon, 18 Dec 2017 09:21:37 +0000 (10:21 +0100)]
cli: refactor comand name helper
use shorter and also a bit faster methods to expand and get comand
names
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Thomas Lamprecht [Mon, 18 Dec 2017 09:21:36 +0000 (10:21 +0100)]
cli: factor out initialisation check
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>