Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
b3874f00
Commit
b3874f00
authored
Sep 05, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert pvesubscription into a PVE::CLI class
parent
96860456
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
73 deletions
+49
-73
Makefile
PVE/CLI/Makefile
+1
-1
pvesubscription.pm
PVE/CLI/pvesubscription.pm
+45
-0
Makefile
bin/Makefile
+1
-11
pvesubscription
bin/pvesubscription
+2
-61
No files found.
PVE/CLI/Makefile
View file @
b3874f00
include
../../defines.mk
SOURCES
=
vzdump.pm
SOURCES
=
vzdump.pm
pvesubscription.pm
.PHONY
:
install
install
:
${SOURCES}
...
...
PVE/CLI/pvesubscription.pm
0 → 100755
View file @
b3874f00
package
PVE::CLI::
pvesubscription
;
use
strict
;
use
warnings
;
use
PVE::
Tools
;
use
PVE::
SafeSyslog
;
use
PVE::
INotify
;
use
PVE::
RPCEnvironment
;
use
PVE::
CLIHandler
;
use
PVE::API2::
Subscription
;
use
base
qw(PVE::CLIHandler)
;
my
$nodename
=
PVE::INotify::
nodename
();
our
$cmddef
=
{
update
=>
[
'
PVE::API2::Subscription
',
'
update
',
undef
,
{
node
=>
$nodename
}
],
get
=>
[
'
PVE::API2::Subscription
',
'
get
',
undef
,
{
node
=>
$nodename
},
sub
{
my
$info
=
shift
;
foreach
my
$k
(
sort
keys
%
$info
)
{
print
"
$k
:
$info
->{
$k
}
\n
";
}
}],
set
=>
[
'
PVE::API2::Subscription
',
'
set
',
['
key
'],
{
node
=>
$nodename
}
],
};
1
;
__END__
=head1 NAME
pvesubscription - Proxmox VE subscription mamager
=head1 SYNOPSIS
=include synopsis
=head1 DESCRIPTION
This tool is used to handle pve subscriptions.
=include pve_copyright
bin/Makefile
View file @
b3874f00
...
...
@@ -3,7 +3,7 @@ include ../defines.mk
SUBDIRS
=
init.d cron ocf
test
SERVICES
=
pvestatd pveproxy
CLITOOLS
=
vzdump
CLITOOLS
=
vzdump
pvesubscription
SCRIPTS
=
\
${
SERVICES
}
\
...
...
@@ -15,7 +15,6 @@ SCRIPTS = \
pvedaemon
\
spiceproxy
\
pveversion
\
pvesubscription
\
pvemailforward.pl
\
pveupgrade
\
pveperf
...
...
@@ -28,7 +27,6 @@ CLI_MANS = \
pvedaemon.1
\
spiceproxy.1
\
pveversion.1
\
pvesubscription.1
\
pveupgrade.1
\
pveperf.1
...
...
@@ -56,10 +54,6 @@ pveversion.1.pod: pveversion
podselect
$<
>
$@
.tmp
mv
$@
.tmp
$@
pvesubscription.1.pod
:
pvesubscription
podselect
$<
>
$@
.tmp
mv
$@
.tmp
$@
pveupgrade.1.pod
:
pveupgrade
podselect
$<
>
$@
.tmp
mv
$@
.tmp
$@
...
...
@@ -88,9 +82,6 @@ pvectl.1.pod: pvectl
pveceph.1.pod
:
pveceph
perl
-I
..
-T
./pveceph printmanpod
>
$@
pvesubscription.1.pod
:
pvesubscription
perl
-I
..
-T
./pvesubscription printmanpod
>
$@
vzrestore.1.pod
:
vzrestore
perl
-I
.. ./vzrestore printmanpod
>
$@
...
...
@@ -111,7 +102,6 @@ install: ${SCRIPTS} ${CLI_MANS} ${SERVICE_MANS} pvemailforward $(addsuffix .serv
install
-m
0644
${
SERVICE_MANS
}
${
MAN8DIR
}
install
-d
${
PODDIR
}
for
i
in
${
CLITOOLS
}
;
do
install
-m
0644
$$
i.1.pod
${
PODDIR
}
;
done
install
-m
0644 pvesubscription.1.pod
${
PODDIR
}
for
i
in
${
CLITOOLS
}
;
do
install
-m
0644
-D
$$
i.bash-completion
${
BASHCOMPLDIR
}
/
$$
i
;
done
for
i
in
${
SERVICES
}
;
do
install
-m
0644
-D
$$
i.service-bash-completion
${
BASHCOMPLDIR
}
/
$$
i
;
done
set
-e
&&
for
i
in
${
SUBDIRS
}
;
do
${
MAKE
}
-C
$$
i
$@
;
done
...
...
bin/pvesubscription
View file @
b3874f00
...
...
@@ -3,65 +3,6 @@
use
strict
;
use
warnings
;
use
PVE::
Tools
;
use
PVE::
SafeSyslog
;
use
PVE::
INotify
;
use
PVE::
RPCEnvironment
;
use
PVE::
CLIHandler
;
use
PVE::API2::
Subscription
;
use
PVE::CLI::
pvesubscription
;
use
base
qw(PVE::CLIHandler)
;
my
$nodename
=
PVE::INotify::
nodename
();
sub
prepare
{
$ENV
{'
PATH
'}
=
'
/sbin:/bin:/usr/sbin:/usr/bin
';
initlog
('
pvesubscription
');
die
"
please run as root
\n
"
if
$>
!=
0
;
PVE::INotify::
inotify_init
();
my
$rpcenv
=
PVE::
RPCEnvironment
->
init
('
cli
');
$rpcenv
->
init_request
();
$rpcenv
->
set_language
(
$ENV
{
LANG
});
$rpcenv
->
set_user
('
root@pam
');
}
my
$cmddef
=
{
update
=>
[
'
PVE::API2::Subscription
',
'
update
',
undef
,
{
node
=>
$nodename
}
],
get
=>
[
'
PVE::API2::Subscription
',
'
get
',
undef
,
{
node
=>
$nodename
},
sub
{
my
$info
=
shift
;
foreach
my
$k
(
sort
keys
%
$info
)
{
print
"
$k
:
$info
->{
$k
}
\n
";
}
}],
set
=>
[
'
PVE::API2::Subscription
',
'
set
',
['
key
'],
{
node
=>
$nodename
}
],
};
my
$cmd
=
shift
;
PVE::CLIHandler::
handle_cmd
(
$cmddef
,
"
pvesubscription
",
$cmd
,
\
@ARGV
,
undef
,
$0
,
\&
prepare
);
exit
0
;
__END__
=head1 NAME
pvesubscription - Proxmox VE subscription mamager
=head1 SYNOPSIS
=include synopsis
=head1 DESCRIPTION
This tool is used to handle pve subscriptions.
=include pve_copyright
PVE::CLI::
pvesubscription
->
run_cli
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment