Skip to content

Commit

Permalink
Fill guest_os correctly
Browse files Browse the repository at this point in the history
Fill guest_os correctly, inferring it from Image location

Fixes BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1393547
  • Loading branch information
Ladas committed Jan 10, 2017
1 parent 1927526 commit 4430f7f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ def parse_image(image, is_public)
uid = image.image_id
location = image.image_location
guest_os = (image.platform == "windows") ? "windows" : "linux"
if guest_os == "linux"
guest_os = OperatingSystem.normalize_os_name(location)
guest_os = "linux" if guest_os == "unknown"
end

name = get_from_tags(image, :name)
name = get_from_tags(image, :name)
name ||= image.name
name ||= $1 if location =~ /^(.+?)(\.(image|img))?\.manifest\.xml$/
name ||= uid
Expand Down

0 comments on commit 4430f7f

Please sign in to comment.