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 5
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.5.1 +Version: 1.4.1 Release: 0 Summary: Yggdra base provisioner License: Apache-2.0 @@ -21,6 +21,7 @@ %install %gem_install \ + --doc-files="README" \ -f %gem_packages
View file
ygg_provisioner-1.5.1.gem/checksums.yaml.gz -> ygg_provisioner-1.4.1.gem/checksums.yaml.gz
Changed
@@ -1,7 +1,7 @@ --- -SHA1: - metadata.gz: ef2853f5e87a5d48aa178e84346a30537594892d - data.tar.gz: 6f56938c467ce34565aca59ba877dc8eeee87a5a +SHA256: + metadata.gz: 532b7f6ff8e3ffb5ee067f98d73828c2c03d318827a408011581ecabef1a6c0f + data.tar.gz: 8a14c7c9889cfa0c82c08fbc234a3e328c66f77a0d29675681ec27d31a944e8b SHA512: - metadata.gz: fba80c0ef6ba97ade7f109ca4bb769506b357d60c5e30763feeed49c670e55f81adabcd01adc68a6c0f26042a80cbee02b060e76e7bf1e6a314d898730d400e3 - data.tar.gz: ce3c153f0c79a080f54896a9a0eaf00c96f79589b04892e521ac9ed6682b89d2f257d8613f944aeb5eabf6b2733007ca064d90a725237fa7e6ea8d074a133581 + metadata.gz: 3d935126a14348d57781c6943c277e782685e070bbe4d6e472be2a39b9f118fde0f877d825644a2e6067fabdb61b252740d374450b3760712308d2aa50ad5809 + data.tar.gz: 3f340c584ed447ae31c31def373d06139a9c84ff60e6f545744e14f4192e1ae5bec1af7a1565310d589867c1d3cde7dec085e3f6f9b6cc5269ca73c3e149b3b1
View file
ygg_provisioner-1.4.1.gem/data/README
Added
@@ -0,0 +1,1 @@ +Yggdra base provisioner
View file
ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/model.rb -> ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/model.rb
Changed
@@ -8,18 +8,19 @@ # License:: You can redistribute it and/or modify it under the terms of the LICENSE file. # -require 'rufus/tokyo' +require 'kyotocabinet' require 'ygg/provisioner/tools' require 'ygg/provisioner/file_switcher' module Ygg module Provisioner -class Model +class Model < OpenStruct class Error < StandardError ; end class DataError < Error ; end class ProcessError < Error ; end + class DatabaseError < Error ; end extend Tools include Tools @@ -30,45 +31,37 @@ 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) - attr_accessor :cfg + super(*) - # Config - attr_accessor :uuid # All models are supposed to have at least the uuid + self.cfg = agentcfg - def initialize(config = nil) if config:cfg - self.cfg = config:cfg - deserialize_config(config:cfg) if config:cfg - deserialize_state(config:state) if config:state + # We are being de-serialized + update_config(config:cfg) + update_state(config:state) else - self.cfg = config - deserialize_config(config) + update_config(config) end end - def deserialize_config(config) - config.each { |k,v| send("#{k}=", v) rescue nil } + 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) } end - 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 } + def update_state(state) + state.each { |k,v| send("#{k}=", v) if self.state_persistant_keys.include?(k.to_sym) } end def save! @@ -77,9 +70,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 @@ -96,20 +89,26 @@ if @@open_store yield @@open_store else - Rufus::Tokyo::Cabinet.open(db_path) do |store| + db = KyotoCabinet::DB::new + if db.open(db_path, KyotoCabinet::DB::OWRITER | KyotoCabinet::DB::OCREATE) begin - @@open_store = store - yield store + @@open_store = db + yield db 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.uuid = Marshal.dump(model.serialize) + storemodel.id = Marshal.dump(model.serialize) end model @@ -124,7 +123,7 @@ def self.each with_open_store do |store| - store.each do |obj_uuid,obj| + store.each do |obj_id,obj| begin obj = new_from_serialized(Marshal.load(obj)) @@ -132,16 +131,16 @@ # rescue # # Ignore corrupted obj data -# # plog.warn "Site #{obj_uuid} configuration is corrupted" +# # plog.warn "Site #{obj_id} configuration is corrupted" end end end end - def self.find(uuid) + def self.find(id) obj = nil with_open_store do |store| - obj = storeuuid + obj = storeid raise NotFound if !obj obj = new_from_serialized(Marshal.load(obj)) end @@ -149,12 +148,12 @@ obj end - def self.delete(uuid) + def self.delete(id) obj = nil with_open_store do |store| - obj = storeuuid + obj = storeid raise NotFound if !obj - store.delete uuid + store.delete id end end @@ -173,14 +172,14 @@ good_count = 0 with_open_store do |store| - store.each do |obj_uuid,obj_marshalled| + store.each do |obj_id,obj_marshalled| begin obj_unmarshalled = nil begin obj_unmarshalled = Marshal.load(obj_marshalled) rescue Exception => e - corrupted_objsobj_uuid = { :reason => 'Unmarshal failed', :data => Base64.encode64(obj_marshalled) } + corrupted_objsobj_id = { :reason => 'Unmarshal failed', :data => Base64.encode64(obj_marshalled) } raise end @@ -188,7 +187,7 @@ begin obj = new_from_serialized(obj_unmarshalled) rescue Exception => e - corrupted_objsobj_uuid = { + corrupted_objsobj_id = { :reason => "Loading failed: #{e.to_s}", :data => obj_unmarshalled }
View file
ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/task.rb -> ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/task.rb
Changed
@@ -27,7 +27,7 @@ def log(level, msg) @text << msg + "\n" - @other_log.info msg + @other_log.send level, msg end def debug(msg) ; log :debug, msg ; end @@ -135,7 +135,6 @@ 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 @@ -149,14 +148,14 @@ end rescue PermanentFailure => e plog.error e.message - report_event(:PERMANENT_FAILURE, plog.text) { errback.call(e) } + report_event(:PERMANENT_FAILURE, plog.text) { yield nil } rescue TemporaryFailure, PublishError => e plog.error e.message - report_event(:TEMPORARY_FAILURE, plog.text) { errback.call(e) } + report_event(:TEMPORARY_FAILURE, plog.text) { yield nil } rescue Exception => e log.exception e plog.error e.message - report_event(:TEMPORARY_FAILURE, plog.text) { errback.call(e) } + report_event(:TEMPORARY_FAILURE, plog.text) { yield nil } else report_event(:COMPLETED, plog.text, result_data) { yield result_data } end
View file
ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/tools.rb -> ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/tools.rb
Changed
@@ -96,7 +96,6 @@ end def run_command(cmd, opts = {}, &block) - if block run_command_async(cmd, opts, &block) @@ -138,6 +137,8 @@ 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.5.1.gem/data/lib/ygg/provisioner/version.rb -> ygg_provisioner-1.4.1.gem/data/lib/ygg/provisioner/version.rb
Changed
@@ -11,7 +11,7 @@ module Ygg module Provisioner - VERSION = '1.5.1' + VERSION = '1.4.1' end end
View file
ygg_provisioner-1.5.1.gem/data/lib/ygg/provisioner/worker.rb -> ygg_provisioner-1.4.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(:errback => Proc.new { |e| request.error(e) }) do |res| + ).execute do |res| request.return(res) end
View file
ygg_provisioner-1.5.1.gem/data/ygg_provisioner.gemspec -> ygg_provisioner-1.4.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 'rufus-tokyo', '~> 11.0.0' - s.add_runtime_dependency 'eventmachine', '~> 1.0.3' - s.add_runtime_dependency 'vihai-publisher' + s.add_runtime_dependency 'kyotocabinet' + s.add_runtime_dependency 'eventmachine', '~> 1.2.3' + s.add_runtime_dependency 'publisher' end
View file
ygg_provisioner-1.5.1.gem/metadata.gz -> ygg_provisioner-1.4.1.gem/metadata.gz
Changed
@@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: ygg_provisioner version: !ruby/object:Gem::Version - version: 1.5.1 + version: 1.4.1 platform: ruby authors: - Daniele Orlandi autorequire: bindir: bin cert_chain: -date: 2014-04-28 00:00:00.000000000 Z +date: 2020-06-04 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: rufus-tokyo + name: kyotocabinet requirement: !ruby/object:Gem::Requirement requirements: - - - "~>" + - - ">=" - !ruby/object:Gem::Version - version: 11.0.0 + version: '0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - "~>" + - - ">=" - !ruby/object:Gem::Version - version: 11.0.0 + version: '0' - !ruby/object:Gem::Dependency name: eventmachine requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 1.0.3 + version: 1.2.3 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 1.0.3 + version: 1.2.3 - !ruby/object:Gem::Dependency - name: vihai-publisher + name: publisher requirement: !ruby/object:Gem::Requirement requirements: - - ">=" @@ -75,6 +75,7 @@ files: - ".gitignore" - Gemfile +- README - Rakefile - lib/tomte/agents/skel_provisioner.rb - lib/ygg/provisioner.rb @@ -106,10 +107,8 @@ - !ruby/object:Gem::Version version: '0' requirements: -rubyforge_project: ygg_provisioner -rubygems_version: 2.2.2 +rubygems_version: 3.1.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
.