Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
9d161d2f
Commit
9d161d2f
authored
Mar 11, 2010
by
Jonathon Duerig
Browse files
When running inside of an elabinelab, use the outer elab to prefix hostnames.
parent
fe081316
Changes
4
Hide whitespace changes
Inline
Side-by-side
protogeni/lib/GeniCM.pm.in
View file @
9d161d2f
...
...
@@ -178,7 +178,8 @@ sub Resolve($)
my
$
blob
=
{
"hrn"
=>
"${PGENIDOMAIN}."
.
$
node
->
node_id
(),
"uuid"
=>
$
node
->
uuid
(),
"role"
=>
$
node
->
role
(),
"hostname"
=>
$
node
->
node_id
()
.
".${OURDOMAIN}"
,
"hostname"
=>
GeniUtil
::
FindHostname
($
node
->
node_id
()),
"physctrl"
=>
Interface
->
LookupControl
(
$
node
->
phys_nodeid
()
)->
IP
(),
"urn"
=>
GeniHRN
::
Generate
(
$
OURDOMAIN
,
...
...
protogeni/lib/GeniCMV2.pm.in
View file @
9d161d2f
...
...
@@ -140,7 +140,8 @@ sub Resolve($)
my
$
blob
=
{
"hrn"
=>
"${PGENIDOMAIN}."
.
$
node
->
node_id
(),
"uuid"
=>
$
node
->
uuid
(),
"role"
=>
$
node
->
role
(),
"hostname"
=>
$
node
->
node_id
()
.
".${OURDOMAIN}"
,
"hostname"
=>
GeniUtil
::
FindHostname
($
node
->
node_id
()),
"physctrl"
=>
Interface
->
LookupControl
($
node
->
phys_nodeid
())->
IP
(),
"urn"
=>
GeniHRN
::
Generate
($
OURDOMAIN
,
...
...
protogeni/lib/GeniSliver.pm.in
View file @
9d161d2f
...
...
@@ -667,14 +667,14 @@ sub Create($$$$$$)
$hrn = "${PGENIDOMAIN}." . $vnode->node_id();
$sliver_uuid = $vnode->uuid();
$resource_id = $vnode->node_id();
$hostname =
$vnode->node_id() . ".${OURDOMAIN}"
;
$hostname =
GeniUtil::FindHostname($vnode->node_id())
;
$sshdport = $vnode->sshdport();
}
else {
$hrn = "${PGENIDOMAIN}." . $node->node_id();
$sliver_uuid = $node->uuid();
$resource_id = $node->node_id();
$hostname =
$node->node_id() . ".${OURDOMAIN}"
;
$hostname =
GeniUtil::FindHostname($node->node_id())
;
}
#
...
...
protogeni/lib/GeniUtil.pm.in
View file @
9d161d2f
...
...
@@ -11,7 +11,7 @@ use Exporter;
use
vars
qw
(@
ISA
@
EXPORT
);
@
ISA
=
"Exporter"
;
@
EXPORT
=
qw
(
NewUUID
GENI_PURGEFLAG
);
@
EXPORT
=
qw
(
NewUUID
GENI_PURGEFLAG
FindHostname
);
use
English
;
use
Data
::
Dumper
;
...
...
@@ -19,12 +19,14 @@ use XML::Simple;
use
GeniHRN
;
#
Configure
variables
my
$
TB
=
"@prefix@"
;
my
$
TBOPS
=
"@TBOPSEMAIL@"
;
my
$
OURDOMAIN
=
"@OURDOMAIN@"
;
my
$
UUIDGEN
=
"@UUIDGEN@"
;
my
$
user
=
"geniuser"
;
my
$
group
=
"GeniSlices"
;
my
$
TB
=
"@prefix@"
;
my
$
TBOPS
=
"@TBOPSEMAIL@"
;
my
$
OURDOMAIN
=
"@OURDOMAIN@"
;
my
$
UUIDGEN
=
"@UUIDGEN@"
;
my
$
ELABINELAB
=
"@ELABINELAB@"
;
my
$
OUTERBOSS_NODENAME
=
"@OUTERBOSS_NODENAME@"
;
my
$
user
=
"geniuser"
;
my
$
group
=
"GeniSlices"
;
sub
GENI_PURGEFLAG
()
{
return
1
;
}
...
...
@@ -117,5 +119,16 @@ sub LookupNode($)
return Node->Lookup($nodeid);
}
sub FindHostname($)
{
my ($nodeid) = @_;
my $prefix = $OURDOMAIN;
if ($ELABINELAB == 1) {
$OUTERBOSS_NODENAME =~ /^[^.]+\.(.*)$/;
$prefix = $1;
}
return $nodeid . "." . $prefix;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Write
Preview
Supports
Markdown
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