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
e651cf0b
Commit
e651cf0b
authored
Oct 14, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new logfunc callback for run_command
parent
647069ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
VZDump.pm
PVE/VZDump.pm
+2
-15
OpenVZ.pm
PVE/VZDump/OpenVZ.pm
+2
-1
No files found.
PVE/VZDump.pm
View file @
e651cf0b
...
@@ -65,25 +65,12 @@ sub debugmsg {
...
@@ -65,25 +65,12 @@ sub debugmsg {
sub
run_command
{
sub
run_command
{
my
(
$logfd
,
$cmdstr
,
%
param
)
=
@_
;
my
(
$logfd
,
$cmdstr
,
%
param
)
=
@_
;
my
$returnstdout
=
$param
{
returnstdout
};
my
$logfunc
=
sub
{
delete
$param
{
returnstdout
};
my
$ostream
=
0
;
my
$outfunc
=
sub
{
my
$line
=
shift
;
my
$line
=
shift
;
$ostream
.=
"
$line
\n
"
if
$returnstdout
;
debugmsg
('
info
',
$line
,
$logfd
);
debugmsg
('
info
',
$line
,
$logfd
);
};
};
my
$errfunc
=
sub
{
PVE::Tools::
run_command
(
$cmdstr
,
%
param
,
logfunc
=>
$logfunc
);
my
$line
=
shift
;
debugmsg
('
info
',
$line
,
$logfd
);
};
PVE::Tools::
run_command
(
$cmdstr
,
%
param
,
outfunc
=>
$outfunc
,
errfunc
=>
$errfunc
);
return
$returnstdout
?
$ostream
:
undef
;
}
}
sub
storage_info
{
sub
storage_info
{
...
...
PVE/VZDump/OpenVZ.pm
View file @
e651cf0b
...
@@ -92,7 +92,8 @@ sub type {
...
@@ -92,7 +92,8 @@ sub type {
sub
vm_status
{
sub
vm_status
{
my
(
$self
,
$vmid
)
=
@_
;
my
(
$self
,
$vmid
)
=
@_
;
my
$status_text
=
$self
->
cmd
("
vzctl status
$vmid
",
returnstdout
=>
1
);
my
$status_text
=
'';
$self
->
cmd
("
vzctl status
$vmid
",
outfunc
=>
sub
{
$status_text
.=
shift
;
});
chomp
$status_text
;
chomp
$status_text
;
my
$running
=
$status_text
=~
m/running/
?
1
:
0
;
my
$running
=
$status_text
=~
m/running/
?
1
:
0
;
...
...
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