Redo build_list publish to check returned status. Refs #77

This commit is contained in:
Pavel Chipiga 2011-12-22 01:31:05 +02:00
parent 71da0a51d8
commit 2ac4391edf
1 changed files with 6 additions and 7 deletions

View File

@ -103,13 +103,12 @@ class BuildList < ActiveRecord::Base
end
end
end
def publish
return false unless can_publish?
BuildServer.publish_container bs_id
self.update_attribute(:status, BUILD_PUBLISHED)
#self.destroy # self.delete
has_published = BuildServer.publish_container bs_id
update_attribute(:status, BUILD_PUBLISHED) if has_published == 0
return has_published == 0
end
def can_publish?
@ -119,7 +118,7 @@ class BuildList < ActiveRecord::Base
def cancel
has_canceled = BuildServer.delete_build_list bs_id
update_attribute(:status, BUILD_CANCELED) if has_canceled == 0
return has_canceled == 0
end