Class: CephStorage::ClusterFactory

Inherits:
Cluster
  • Object
show all
Defined in:
lib/ceph_storage/cluster_factory.rb

Overview

Factory Class to create a Cluster reference object

Constant Summary collapse

CONFIG_DIR =

Defaults

'/etc/ceph'.freeze
CLUSTER =
'ceph'.freeze
USER =
'client.admin'.freeze
FLAGS =
0

Instance Attribute Summary

Attributes inherited from Cluster

#cluster, #cluster_fd, #config_dir, #flags, #user

Class Method Summary collapse

Methods inherited from Cluster

#ensure_open, #initialize, #open, #open?, #path, #pool, #pools, #rados_cluster, #shutdown

Methods included from ClusterWrapper

#wrap_me

Constructor Details

This class inherits a constructor from CephStorage::Cluster

Class Method Details

.build(config_dir: CONFIG_DIR, cluster: CLUSTER, user: USER, flags: FLAGS) {|c| ... } ⇒ Object

Create a factory method for creating Cluster Objects

Yields:

  • (c)


11
12
13
14
15
16
17
# File 'lib/ceph_storage/cluster_factory.rb', line 11

def build(config_dir: CONFIG_DIR, cluster: CLUSTER,
          user: USER, flags: FLAGS)
  c = Cluster.new(cluster: cluster, config_dir: config_dir,
                  user: user, flags: flags)
  yield(c) if block_given?
  c
end