Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
7fba23e3
Commit
7fba23e3
authored
Nov 09, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some "use module" shuffling around. Minor changes to sliveraction, as
for logging errors.
parent
87f69b3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
28 deletions
+17
-28
protogeni/lib/GeniCMV2.pm.in
protogeni/lib/GeniCMV2.pm.in
+17
-28
No files found.
protogeni/lib/GeniCMV2.pm.in
View file @
7fba23e3
...
@@ -20,34 +20,24 @@ use vars qw(@ISA @EXPORT);
...
@@ -20,34 +20,24 @@ use vars qw(@ISA @EXPORT);
#
Must
come
after
package
declaration
!
#
Must
come
after
package
declaration
!
use
lib
'@prefix@/lib'
;
use
lib
'@prefix@/lib'
;
use
GeniDB
;
use
GeniDB
;
use
Genixmlrpc
;
use
GeniResponse
;
use
GeniResponse
;
use
GeniTicket
;
use
GeniTicket
;
use
GeniCredential
;
use
GeniCredential
;
use
GeniCertificate
;
use
GeniCertificate
;
use
GeniSlice
;
use
GeniSlice
;
use
GeniAggregate
;
use
GeniAggregate
;
use
GeniAuthority
;
use
GeniSliver
;
use
GeniSliver
;
use
GeniUser
;
use
GeniRegistry
;
use
GeniUtil
;
use
GeniUtil
;
use
GeniCM
;
use
GeniCM
;
use
GeniHRN
;
use
GeniHRN
;
use
GeniXML
;
use
GeniXML
;
use
libtestbed
qw
(
SENDMAIL
);
use
emutil
;
use
emutil
;
#
Hate
to
import
all
this
crap
;
need
a
utility
library
.
use
libdb
qw
(
TBGetSiteVar
EXPTSTATE_SWAPPED
EXPTSTATE_ACTIVE
TBOPSPID
TBDB_NODESTATE_TBFAILED
);
use
Node
;
use
English
;
use
English
;
use
Data
::
Dumper
;
use
Data
::
Dumper
;
use
XML
::
Simple
;
use
XML
::
Simple
;
use
Date
::
Parse
;
use
Date
::
Parse
;
use
POSIX
qw
(
strftime
tmpnam
);
use
POSIX
qw
(
strftime
tmpnam
);
use
Time
::
Local
;
use
Time
::
Local
;
use
Experiment
;
use
Compress
::
Zlib
;
use
Compress
::
Zlib
;
use
MIME
::
Base64
;
use
MIME
::
Base64
;
...
@@ -79,8 +69,7 @@ my $PRERENDER = "$TB/libexec/vis/prerender";
...
@@ -79,8 +69,7 @@ my $PRERENDER = "$TB/libexec/vis/prerender";
my
$
EMULAB_PEMFILE
=
"@prefix@/etc/genicm.pem"
;
my
$
EMULAB_PEMFILE
=
"@prefix@/etc/genicm.pem"
;
#
Just
one
of
these
,
at
Utah
.
#
Just
one
of
these
,
at
Utah
.
my
$
GENICH_PEMFILE
=
"@prefix@/etc/genich.pem"
;
my
$
GENICH_PEMFILE
=
"@prefix@/etc/genich.pem"
;
my
$
API_VERSION
=
2
;
my
$
API_VERSION
=
2
;
#
#
#
Tell
the
client
what
API
revision
we
support
.
The
correspondence
#
Tell
the
client
what
API
revision
we
support
.
The
correspondence
...
@@ -97,7 +86,7 @@ sub GetVersion()
...
@@ -97,7 +86,7 @@ sub GetVersion()
"output_rspec"
=>
"0.1"
"output_rspec"
=>
"0.1"
};
};
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
,
$
blob
);
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
,
$
blob
);
}
}
#
#
...
@@ -268,6 +257,8 @@ sub CreateSliver($)
...
@@ -268,6 +257,8 @@ sub CreateSliver($)
my
$
credentials
=
$
argref
->{
'credentials'
};
my
$
credentials
=
$
argref
->{
'credentials'
};
my
$
keys
=
$
argref
->{
'keys'
};
my
$
keys
=
$
argref
->{
'keys'
};
my
$
impotent
=
$
argref
->{
'impotent'
}
||
0
;
my
$
impotent
=
$
argref
->{
'impotent'
}
||
0
;
require
Node
;
require
Experiment
;
#
For
now
,
I
am
not
worrying
about
the
slice_urn
argument
.
#
For
now
,
I
am
not
worrying
about
the
slice_urn
argument
.
if
(
! (defined($credentials) &&
if
(
! (defined($credentials) &&
...
@@ -699,24 +690,21 @@ sub SliverAction($$$$$)
...
@@ -699,24 +690,21 @@ sub SliverAction($$$$$)
my
$
PerformAction
=
sub
{
my
$
PerformAction
=
sub
{
my
($
object
,
$
action
)
=
@
_
;
my
($
object
,
$
action
)
=
@
_
;
my
$
exitval
=
0
;
if
($
action
eq
"start"
)
{
if
($
action
eq
"start"
)
{
if
($
object
->
Start
($
API_VERSION
,
0
)
!= 0) {
$
exitval
=
$
object
->
Start
($
API_VERSION
,
0
);
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"Could not start sliver"
);
}
}
}
elsif
($
action
eq
"stop"
)
{
elsif
($
action
eq
"stop"
)
{
if
($
object
->
Stop
($
API_VERSION
)
!= 0) {
$
exitval
=
$
object
->
Stop
($
API_VERSION
);
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"Could not stop sliver"
);
}
}
}
elsif
($
action
eq
"restart"
)
{
elsif
($
action
eq
"restart"
)
{
if
($
object
->
Start
($
API_VERSION
,
1
)
!= 0) {
$
exitval
=
$
object
->
Start
($
API_VERSION
,
1
);
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"Could not restart sliver"
);
}
}
}
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
"Could not $action sliver"
)
if
($
exitval
);
return
0
;
return
0
;
};
};
...
@@ -887,6 +875,7 @@ sub Shutdown($)
...
@@ -887,6 +875,7 @@ sub Shutdown($)
my
$
slice_urn
=
$
argref
->{
'slice_urn'
};
my
$
slice_urn
=
$
argref
->{
'slice_urn'
};
my
$
clear
=
$
argref
->{
'clear'
}
||
0
;
my
$
clear
=
$
argref
->{
'clear'
}
||
0
;
my
$
credentials
=
$
argref
->{
'credentials'
};
my
$
credentials
=
$
argref
->{
'credentials'
};
require
libtestbed
;
if
(
! (defined($credentials) && defined($slice_urn))) {
if
(
! (defined($credentials) && defined($slice_urn))) {
return
GeniResponse
->
MalformedArgsResponse
(
"Missing arguments"
);
return
GeniResponse
->
MalformedArgsResponse
(
"Missing arguments"
);
...
@@ -946,8 +935,8 @@ sub Shutdown($)
...
@@ -946,8 +935,8 @@ sub Shutdown($)
return
GeniResponse
->
BusyResponse
();
return
GeniResponse
->
BusyResponse
();
}
}
if
(
GeniCM
::
CleanupDeadSlice
($
slice
,
0
)
!= 0) {
if
(
GeniCM
::
CleanupDeadSlice
($
slice
,
0
)
!= 0) {
SENDMAIL
($
TBOPS
,
"Emergency Shutdown failed"
,
libtestbed
::
SENDMAIL
($
TBOPS
,
"Emergency Shutdown failed"
,
"Emergency shutdown failed on $slice
\n
"
);
"Emergency shutdown failed on $slice
\n
"
);
print
STDERR
"Could not shutdown $slice!
\n
"
;
print
STDERR
"Could not shutdown $slice!
\n
"
;
#
Lets
call
this
a
non
-
error
since
the
local
admin
person
#
Lets
call
this
a
non
-
error
since
the
local
admin
person
#
is
going
to
have
to
deal
with
it
anyway
.
#
is
going
to
have
to
deal
with
it
anyway
.
...
@@ -1365,7 +1354,7 @@ sub ReleaseTicket($)
...
@@ -1365,7 +1354,7 @@ sub ReleaseTicket($)
my
($
slice
,
$
aggregate
)
=
Credential2SliceAggregate
($
credential
);
my
($
slice
,
$
aggregate
)
=
Credential2SliceAggregate
($
credential
);
if
(
! (defined($slice))) {
if
(
! (defined($slice))) {
return
GeniResponse
->
Create
(
GENIRESPONSE_
BADARGS
,
undef
,
return
GeniResponse
->
Create
(
GENIRESPONSE_
SEARCHFAILED
,
undef
,
"No slice here"
);
"No slice here"
);
}
}
if
($
slice_urn
ne
$
slice
->
urn
())
{
if
($
slice_urn
ne
$
slice
->
urn
())
{
...
...
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