Class: Snapback::Configuration::Configuration_0_0_3

Inherits:
Object
  • Object
show all
Defined in:
lib/snapback/configuration/Configuration_0_0_3.rb

Instance Method Summary collapse

Constructor Details

#initialize(yaml) ⇒ Configuration_0_0_3

Returns a new instance of Configuration_0_0_3.



7
8
9
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 7

def initialize(yaml)
  @@yaml = yaml
end

Instance Method Details

#filesystem_mount_directory(database) ⇒ Object



90
91
92
93
94
95
96
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 90

def filesystem_mount_directory(database)
  begin
    "#{@@yaml['filesystem']['mount']}/#{database}"
  rescue
    "/mnt/snapback-#{database}"
  end
end

#lvm_database_prefixObject



39
40
41
42
43
44
45
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 39

def lvm_database_prefix
  begin
    @@yaml['lvm']['database_prefix']
  rescue
    nil
  end
end

#lvm_logical_database(database) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 23

def lvm_logical_database(database)
  begin
    "#{@@yaml['lvm']['database_prefix']}-#{database}"
  rescue
    "snapback-database-#{database}"
  end
end

#lvm_logical_snapshot(database) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 31

def lvm_logical_snapshot(database)
  begin
    "#{@@yaml['lvm']['snapshot_prefix']}-#{database}"
  rescue
    "snapback-snapshot-#{database}"
  end
end

#lvm_snapshot_prefixObject



47
48
49
50
51
52
53
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 47

def lvm_snapshot_prefix
  begin
    @@yaml['lvm']['snapshot_prefix']
  rescue
    nil
  end
end

#lvm_volume_groupObject



15
16
17
18
19
20
21
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 15

def lvm_volume_group
  begin
    @@yaml['lvm']['volume_group']
  rescue
    nil
  end
end

#mysql_clientObject



55
56
57
58
59
60
61
62
63
64
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 55

def mysql_client
  client = Snapback::MySQL::ClientControl.instance

  client.hostname = mysql_hostname
  client.username = mysql_username
  client.password = mysql_password
  client.connect

  client
end

#mysql_hostnameObject



66
67
68
69
70
71
72
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 66

def mysql_hostname
  begin
    @@yaml['mysql']['hostname']
  rescue
    nil
  end
end

#mysql_passwordObject



82
83
84
85
86
87
88
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 82

def mysql_password
  begin
    @@yaml['mysql']['password']
  rescue
    nil
  end
end

#mysql_usernameObject



74
75
76
77
78
79
80
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 74

def mysql_username
  begin
    @@yaml['mysql']['username']
  rescue
    nil
  end
end

#versionObject



11
12
13
# File 'lib/snapback/configuration/Configuration_0_0_3.rb', line 11

def version
  @@yaml['version']
end