Skip to content

Commit

Permalink
B #6184: Fix LXD market monitoring (#2584)
Browse files Browse the repository at this point in the history
  • Loading branch information
dann1 authored Apr 20, 2023
1 parent bf60b38 commit 16035a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/market_mad/remotes/linuxcontainers/monitor
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ class LinuxContainersMarket
#-----------------------------------------------------------------------
tree.each do |distro, value|
value.each do |version, path|
path = URI.decode_www_form_component(path)

description = "Downloaded from #{@options[:url]}"
regtime = app_time(path).to_s

Expand Down Expand Up @@ -190,10 +192,8 @@ class LinuxContainersMarket

# Returns build date based on image path
def app_time(path)
m1 = 'amd64/default/./'
m2 = '/rootfs.tar.xz'
buildate = path.split('/')[6]

buildate = path[/#{m1}(.*?)#{m2}/m, 1]
buildate = DateTime.strptime(buildate, '%Y%m%d_%H:%M')
buildate.to_time.to_i
end
Expand Down

0 comments on commit 16035a1

Please sign in to comment.