Package: pcs / 0.9.155+dfsg-2+deb9u1

0006-Replace-orderedhash.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Description: Replace orderedhash gem with active_support
 Gem orderedhash <https://rubygems.org/gems/orderedhash/>
 has several problems:
 * not packaged in Debian (so not used by some other software)
 * does not look maintained (last version 0.0.6 is from 2008)
 * no license file included (just one mention of public domain
   in a source file)
 .
 On the other hand, replacement active_support gem is rather
 popular (albeit somewhat big) and does not experience any of
 these problems.
Author: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Last-Update: 2017-06-17
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/pcsd/config.rb
+++ b/pcsd/config.rb
@@ -1,5 +1,5 @@
 require 'json'
-require 'orderedhash'
+require 'active_support/ordered_hash'
 
 require 'cluster.rb'
 require 'permissions.rb'
@@ -124,15 +124,15 @@
   end
 
   def text()
-    out_hash = OrderedHash.new
+    out_hash = ActiveSupport::OrderedHash.new
     out_hash['format_version'] = CURRENT_FORMAT
     out_hash['data_version'] = @data_version
     out_hash['clusters'] = []
-    out_hash['permissions'] = OrderedHash.new
+    out_hash['permissions'] = ActiveSupport::OrderedHash.new
     out_hash['permissions']['local_cluster'] = []
 
     @clusters.each { |c|
-      c_hash = OrderedHash.new
+      c_hash = ActiveSupport::OrderedHash.new
       c_hash['name'] = c.name
       c_hash['nodes'] = c.nodes.uniq.sort
       out_hash['clusters'] << c_hash
@@ -226,10 +226,10 @@
   end
 
   def text()
-    tokens_hash = OrderedHash.new
+    tokens_hash = ActiveSupport::OrderedHash.new
     @tokens.keys.sort.each { |key| tokens_hash[key] = @tokens[key] }
 
-    out_hash = OrderedHash.new
+    out_hash = ActiveSupport::OrderedHash.new
     out_hash['format_version'] = CURRENT_FORMAT
     out_hash['data_version'] = @data_version
     out_hash['tokens'] = tokens_hash
--- a/pcsd/pcsd-cli.rb
+++ b/pcsd/pcsd-cli.rb
@@ -4,14 +4,14 @@
 require 'etc'
 require 'json'
 require 'stringio'
-require 'orderedhash'
+require 'active_support/ordered_hash'
 
 require 'bootstrap.rb'
 require 'pcs.rb'
 require 'auth.rb'
 
 def cli_format_response(status, text=nil, data=nil)
-  response = OrderedHash.new
+  response = ActiveSupport::OrderedHash.new
   response['status'] = status
   response['text'] = text if text
   response['data'] = data if data
--- a/pcsd/permissions.rb
+++ b/pcsd/permissions.rb
@@ -1,4 +1,4 @@
-require 'orderedhash'
+require 'active_support/ordered_hash'
 
 module Permissions
 
@@ -104,7 +104,7 @@
     end
 
     def to_hash()
-      perm_hash = OrderedHash.new
+      perm_hash = ActiveSupport::OrderedHash.new
       perm_hash['type'] = @type
       perm_hash['name'] = @name
       perm_hash['allow'] = @allow_list.uniq.sort
--- a/pcsd/Gemfile
+++ b/pcsd/Gemfile
@@ -15,4 +15,4 @@
 gem 'json'
 gem 'multi_json'
 gem 'open4'
-gem 'orderedhash'
+gem 'activesupport'