This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new e166623 WHIMSY-366 - don't rely on Infra puppet repo
e166623 is described below
commit e166623244f5dd74bceb1c88b3c77b0d82850a6a
Author: Sebb <[email protected]>
AuthorDate: Fri Aug 6 21:55:17 2021 +0100
WHIMSY-366 - don't rely on Infra puppet repo
---
lib/whimsy/asf/git.rb | 14 --------------
lib/whimsy/asf/ldap.rb | 16 +---------------
2 files changed, 1 insertion(+), 29 deletions(-)
diff --git a/lib/whimsy/asf/git.rb b/lib/whimsy/asf/git.rb
index eaf9c9b..2ea8404 100644
--- a/lib/whimsy/asf/git.rb
+++ b/lib/whimsy/asf/git.rb
@@ -13,9 +13,6 @@ module ASF
# at GitHub.
GITHUB_HOST = 'raw.githubusercontent.com'
- # path to the deployment branch on GitHub.
- INFRA_PUPPET = '/apache/infrastructure-puppet/deployment/'
-
# get a file live from github, e.g. '/apache/petri/master/info.yaml'
# returns body
def self.github(file, etag = nil)
@@ -24,16 +21,6 @@ module ASF
return http.request(Net::HTTP::Get.new(file)).body
end
- # get a file live from infrastructure puppet (e.g. 'data/common.yaml')
- # issues a HTTP GET request, so may be slow and may fail. For applications
- # that require faster and more dependable access,
- # <tt>ASF::Git.find('infrastructure-puppet')</tt> may be used to get
- # access to a clone that is updated every 10 minutes.
- def self.infra_puppet(file)
- self.github(INFRA_PUPPET + file)
- end
-
-
# path to <tt>repository.yml</tt> in the source.
REPOSITORY = File.expand_path('../../../repository.yml', __dir__)
@@ -116,5 +103,4 @@ end
if $0 == __FILE__
require 'net/http'
puts ASF::Git.github('/apache/petri/master/info.yaml')
- puts ASF::Git.infra_puppet('data/common.yaml')
end
\ No newline at end of file
diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index 4d38c8f..17c3ae4 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -59,20 +59,6 @@ module ASF
# Mutex preventing simultaneous connections to LDAP from a single process
CONNECT_LOCK = Mutex.new
- # fetch configuration from apache/infrastructure-puppet
- def self.puppet_config
- return @puppet if @puppet
- # the enclosing method is optional, so we only require the gem here
- require 'yaml'
- require_relative 'git' # just in case
- @puppet = YAML.safe_load(ASF::Git.infra_puppet('data/common.yaml'))
- end
-
- # extract the ldapcert from the puppet configuration
- def self.puppet_cert
- puppet_config['ldapclient::ldapcert']
- end
-
# connect to LDAP
def self.connect(test = true, hosts = nil)
# If the host list is specified, use that as is
@@ -222,7 +208,7 @@ module ASF
# verify/obtain/write the cert
unless cert
cert = "#{ETCLDAP}/asf-ldap-client.pem"
- File.write cert, ASF::LDAP.puppet_cert || self.extract_cert
+ File.write cert, self.extract_cert
end
# read the current configuration file