Skip to content
GitLab
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
4c4b4d34
Commit
4c4b4d34
authored
Dec 03, 2014
by
Leigh B Stoller
Browse files
More fixes for using URLs to specify images.
parent
c0bad738
Changes
2
Hide whitespace changes
Inline
Side-by-side
db/Image.pm.in
View file @
4c4b4d34
...
...
@@ -313,6 +313,13 @@ sub LookupByURL($$)
}
return
undef
;
}
#
Image
is
local
if
the
metadata_url
is
null
.
sub
IsLocal
($)
{
my
($
self
)
=
@
_
;
return
(
defined
($
self
->
metadata_url
())
?
0
:
1
);
}
#
#
Lookup
a
"system"
osid
,
meaning
one
in
the
emulab
-
ops
project
.
...
...
tbsetup/image_setup.in
View file @
4c4b4d34
#!/usr/bin/perl -w
#
# Copyright (c) 2003-201
2
University of Utah and the Flux Group.
# Copyright (c) 2003-201
4
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -149,7 +149,15 @@ while (my ($vname, $osname) = $result->fetchrow()) {
# fetch the image file, or refetch if it is stale.
#
my
$image
=
Image
->
LookupByURL
(
$url
);
if
(
!
defined
(
$image
))
{
if
(
defined
(
$image
))
{
#
# LookupByURL might return a local image, which of course
# we want to skip; later phases know its a local image.
#
next
if
(
$image
->
IsLocal
());
}
else
{
my
$opts
=
"";
$opts
.=
"
-d
"
if
(
$debug
);
...
...
@@ -162,9 +170,11 @@ while (my ($vname, $osname) = $result->fetchrow()) {
next
if
(
$verify
);
$image
=
Image
->
LookupByURL
(
$url
);
if
(
!
defined
(
$image
))
{
tbdie
("
Could not look up image object for
$url
\n
");
$image
=
Image
->
LookupByURL
(
$url
);
if
(
!
defined
(
$image
))
{
tbdie
("
Could not look up image object for
$url
\n
");
}
}
next
if
(
!
$getimages
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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