Projects
home:rottame:rubygems
rubygem-ygg_provisioner
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
rubygem-ygg_provisioner.spec
Changed
@@ -1,7 +1,7 @@ %define mod_name ygg_provisioner %define mod_full_name %{mod_name}-%{version} Name: rubygem-ygg_provisioner -Version: 1.4.1 +Version: 1.5.1 Release: 0 Summary: Yggdra base provisioner License: Apache-2.0
View file
ygg_provisioner-1.4.1.gem/data/README
Deleted
@@ -1,1 +0,0 @@ -Yggdra base provisioner
View file
ygg_provisioner-1.4.1.gem/checksums.yaml.gz -> ygg_provisioner-1.5.1.gem/checksums.yaml.gz
Changed
@@ -1,7 +1,7 @@ --- -SHA256: - metadata.gz: 532b7f6ff8e3ffb5ee067f98d73828c2c03d318827a408011581ecabef1a6c0f - data.tar.gz: 8a14c7c9889cfa0c82c08fbc234a3e328c66f77a0d29675681ec27d31a944e8b +SHA1: + metadata.gz: ef2853f5e87a5d48aa178e84346a30537594892d + data.tar.gz: 6f56938c467ce34565aca59ba877dc8eeee87a5a SHA512: - metadata.gz: 3d935126a14348d57781c6943c277e782685e070bbe4d6e472be2a39b9f118fde0f877d825644a2e6067fabdb61b252740d374450b3760712308d2aa50ad5809 - data.tar.gz: 3f340c584ed447ae31c31def373d06139a9c84ff60e6f545744e14f4192e1ae5bec1af7a1565310d589867c1d3cde7dec085e3f6f9b6cc5269ca73c3e149b3b1 + metadata.gz: fba80c0ef6ba97ade7f109ca4bb769506b357d60c5e30763feeed49c670e55f81adabcd01adc68a6c0f26042a80cbee02b060e76e7bf1e6a314d898730d400e3 + data.tar.gz: ce3c153f0c79a080f54896a9a0eaf00c96f79589b04892e521ac9ed6682b89d2f257d8613f944aeb5eabf6b2733007ca064d90a725237fa7e6ea8d074a133581
View file
ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/model.rb -> ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/model.rb
Changed
@@ -8,19 +8,18 @@ # License:: You can redistribute it and/or modify it under the terms of the LICENSE file. # -require 'kyotocabinet' +require 'rufus/tokyo' require 'ygg/provisioner/tools' require 'ygg/provisioner/file_switcher' module Ygg module Provisioner -class Model < OpenStruct +class Model class Error < StandardError ; end class DataError < Error ; end class ProcessError < Error ; end - class DatabaseError < Error ; end extend Tools include Tools @@ -31,37 +30,45 @@ class_attribute :config class_attribute :worker - class_attribute :state_persistant_keys - self.state_persistant_keys = - class_attribute :db_path attr_accessor :plog - attr_accessor :config_persistant_keys - - def initialize(config) - super(*) + attr_accessor :cfg - self.cfg = agentcfg + # Config + attr_accessor :uuid # All models are supposed to have at least the uuid + def initialize(config = nil) if config:cfg - # We are being de-serialized - update_config(config:cfg) - update_state(config:state) + self.cfg = config:cfg + deserialize_config(config:cfg) if config:cfg + deserialize_state(config:state) if config:state else - update_config(config) + self.cfg = config + deserialize_config(config) end end - def update_config(config) - self.config_persistant_keys = config.keys.map(&:to_sym) - self.config_persistant_keys -= self.state_persistant_keys - config.each { |k,v| send("#{k}=", v) if self.config_persistant_keys.include?(k.to_sym) } + def deserialize_config(config) + config.each { |k,v| send("#{k}=", v) rescue nil } end - def update_state(state) - state.each { |k,v| send("#{k}=", v) if self.state_persistant_keys.include?(k.to_sym) } + def deserialize_state(state) + state.each { |k,v| send("#{k}=", v) } + end + + def serialize_config + cfg + end + + def serialize_state + {} + end + + def update(data, opts = {}) + self.cfg = data + data.each { |k,v| send("#{k}=", v) rescue nil } end def save! @@ -70,9 +77,9 @@ def serialize { - :cfg => self.marshal_dump.select { |k,v| config_persistant_keys.include?(k.to_sym) }, - :state => self.marshal_dump.select { |k,v| state_persistant_keys.include?(k.to_sym) }, :_type => self.class.name, + :cfg => serialize_config, + :state => serialize_state, } end @@ -89,26 +96,20 @@ if @@open_store yield @@open_store else - db = KyotoCabinet::DB::new - if db.open(db_path, KyotoCabinet::DB::OWRITER | KyotoCabinet::DB::OCREATE) + Rufus::Tokyo::Cabinet.open(db_path) do |store| begin - @@open_store = db - yield db + @@open_store = store + yield store ensure - unless db.close - raise DatabaseError.new("Cannot close database #{db_path}: #{db.error}") - end @@open_store = nil end - else - raise DatabaseError.new("Cannot open database #{db_path}: #{db.error}") end end end def self.save(model) with_open_store do |store| - storemodel.id = Marshal.dump(model.serialize) + storemodel.uuid = Marshal.dump(model.serialize) end model @@ -123,7 +124,7 @@ def self.each with_open_store do |store| - store.each do |obj_id,obj| + store.each do |obj_uuid,obj| begin obj = new_from_serialized(Marshal.load(obj)) @@ -131,16 +132,16 @@ # rescue # # Ignore corrupted obj data -# # plog.warn "Site #{obj_id} configuration is corrupted" +# # plog.warn "Site #{obj_uuid} configuration is corrupted" end end end end - def self.find(id) + def self.find(uuid) obj = nil with_open_store do |store| - obj = storeid + obj = storeuuid raise NotFound if !obj obj = new_from_serialized(Marshal.load(obj)) end @@ -148,12 +149,12 @@ obj end - def self.delete(id) + def self.delete(uuid) obj = nil with_open_store do |store| - obj = storeid + obj = storeuuid raise NotFound if !obj - store.delete id + store.delete uuid end end @@ -172,14 +173,14 @@ good_count = 0 with_open_store do |store| - store.each do |obj_id,obj_marshalled| + store.each do |obj_uuid,obj_marshalled| begin obj_unmarshalled = nil begin obj_unmarshalled = Marshal.load(obj_marshalled) rescue Exception => e - corrupted_objsobj_id = { :reason => 'Unmarshal failed', :data => Base64.encode64(obj_marshalled) } + corrupted_objsobj_uuid = { :reason => 'Unmarshal failed', :data => Base64.encode64(obj_marshalled) } raise end @@ -187,7 +188,7 @@ begin obj = new_from_serialized(obj_unmarshalled) rescue Exception => e - corrupted_objsobj_id = { + corrupted_objsobj_uuid = { :reason => "Loading failed: #{e.to_s}", :data => obj_unmarshalled }
View file
ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/task.rb -> ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/task.rb
Changed
@@ -27,7 +27,7 @@ def log(level, msg) @text << msg + "\n" - @other_log.send level, msg + @other_log.info msg end def debug(msg) ; log :debug, msg ; end @@ -135,6 +135,7 @@ def execute(opts = {}, &block) op = self.class.operationsoperation + errback = opts:errback || Proc.new { yield nil } report_started(op.supports_percent ? { :percent => 0 } : {}) do @fiber = Fiber.new do @@ -148,14 +149,14 @@ end rescue PermanentFailure => e plog.error e.message - report_event(:PERMANENT_FAILURE, plog.text) { yield nil } + report_event(:PERMANENT_FAILURE, plog.text) { errback.call(e) } rescue TemporaryFailure, PublishError => e plog.error e.message - report_event(:TEMPORARY_FAILURE, plog.text) { yield nil } + report_event(:TEMPORARY_FAILURE, plog.text) { errback.call(e) } rescue Exception => e log.exception e plog.error e.message - report_event(:TEMPORARY_FAILURE, plog.text) { yield nil } + report_event(:TEMPORARY_FAILURE, plog.text) { errback.call(e) } else report_event(:COMPLETED, plog.text, result_data) { yield result_data } end
View file
ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/tools.rb -> ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/tools.rb
Changed
@@ -96,6 +96,7 @@ end def run_command(cmd, opts = {}, &block) + if block run_command_async(cmd, opts, &block) @@ -137,8 +138,6 @@ opts:env.each { |k,v| ENVk = v } end - plog.debug " = running command #{cmd.inspect}" if plog - c = CommandRunner.open(cmd, !opts:progress) if opts:send_data
View file
ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/version.rb -> ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/version.rb
Changed
@@ -11,7 +11,7 @@ module Ygg module Provisioner - VERSION = '1.4.1' + VERSION = '1.5.1' end end
View file
ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/worker.rb -> ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/worker.rb
Changed
@@ -79,7 +79,7 @@ :operation => verb, :request_data => request.payload.parameters, :also_publish_to => nil, - ).execute do |res| + ).execute(:errback => Proc.new { |e| request.error(e) }) do |res| request.return(res) end
View file
ygg_provisioner-1.4.1.gem/data/ygg_provisioner.gemspec -> ygg_provisioner-1.5.1.gem/data/ygg_provisioner.gemspec
Changed
@@ -19,7 +19,7 @@ s.require_paths = 'lib' s.add_runtime_dependency 'tomte-agents' - s.add_runtime_dependency 'kyotocabinet' - s.add_runtime_dependency 'eventmachine', '~> 1.2.3' - s.add_runtime_dependency 'publisher' + s.add_runtime_dependency 'rufus-tokyo', '~> 11.0.0' + s.add_runtime_dependency 'eventmachine', '~> 1.0.3' + s.add_runtime_dependency 'vihai-publisher' end
View file
ygg_provisioner-1.4.1.gem/metadata.gz -> ygg_provisioner-1.5.1.gem/metadata.gz
Changed
@@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: ygg_provisioner version: !ruby/object:Gem::Version - version: 1.4.1 + version: 1.5.1 platform: ruby authors: - Daniele Orlandi autorequire: bindir: bin cert_chain: -date: 2020-06-04 00:00:00.000000000 Z +date: 2014-04-28 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: tomte-agents @@ -25,35 +25,35 @@ - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency - name: kyotocabinet + name: rufus-tokyo requirement: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: '0' + version: 11.0.0 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: '0' + version: 11.0.0 - !ruby/object:Gem::Dependency name: eventmachine requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 1.2.3 + version: 1.0.3 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 1.2.3 + version: 1.0.3 - !ruby/object:Gem::Dependency - name: publisher + name: vihai-publisher requirement: !ruby/object:Gem::Requirement requirements: - - ">=" @@ -75,7 +75,6 @@ files: - ".gitignore" - Gemfile -- README - Rakefile - lib/tomte/agents/skel_provisioner.rb - lib/ygg/provisioner.rb @@ -107,8 +106,10 @@ - !ruby/object:Gem::Version version: '0' requirements: -rubygems_version: 3.1.2 +rubyforge_project: ygg_provisioner +rubygems_version: 2.2.2 signing_key: specification_version: 4 summary: Provisioner base classes and helpers test_files: +has_rdoc:
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.