class Snapback::Configuration::Configuration_0_0_3

Public Class Methods

new(yaml) click to toggle source
# File lib/snapback/configuration/Configuration_0_0_3.rb, line 7
def initialize(yaml)
  @@yaml = yaml
end

Public Instance Methods

filesystem_mount_directory(database) click to toggle source
# 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_prefix() click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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_prefix() click to toggle source
# 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_group() click to toggle source
# 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_client() click to toggle source
# 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_hostname() click to toggle source
# File lib/snapback/configuration/Configuration_0_0_3.rb, line 66
def mysql_hostname
  begin
    @@yaml['mysql']['hostname']
  rescue
    nil
  end
end
mysql_password() click to toggle source
# File lib/snapback/configuration/Configuration_0_0_3.rb, line 82
def mysql_password
  begin
    @@yaml['mysql']['password']
  rescue
    nil
  end
end
mysql_username() click to toggle source
# File lib/snapback/configuration/Configuration_0_0_3.rb, line 74
def mysql_username
  begin
    @@yaml['mysql']['username']
  rescue
    nil
  end
end
version() click to toggle source
# File lib/snapback/configuration/Configuration_0_0_3.rb, line 11
def version
  @@yaml['version']
end