Sha256: 9cf7bead9cb150b35b3ef2d1688b93a2e7efd0769555f1278debb27ad3dbae4b
Contents?: true
Size: 494 Bytes
Versions: 31
Compression:
Stored size: 494 Bytes
Contents
require "fileutils" class Bosh::Bootstrap::KeyPair include FileUtils attr_reader :base_path, :keyname, :private_key def initialize(base_path, keyname, private_key) @base_path, @keyname, @private_key = base_path, keyname, private_key end def execute! mkdir_p(File.dirname(path)) chmod(0700, File.dirname(path)) File.open(path, "w") { |file| file << private_key } chmod(0600, path) end def path @path ||= File.join(base_path, "ssh", keyname) end end
Version data entries
31 entries across 31 versions & 1 rubygems