from stack import Stack from layers import SnapLayer from params import Params have_libvirt = True try: import libvirt except: have_libvirt = False import os.path,platform,time from lxml import etree from pprint import pformat Params.add_option( "--qemu_url", "--qemu-url", default="qemu:///system", help=("qemu URL")) Params.add_option( "--libvirt_auth_file", "--libvirt-auth-file", default="/var/lib/amanda/libvirt-authfile", help=("Libvirt authentication file")) Params.add_option( "--libvirt_vm_hostname", "--libvirt-vm-hostname", help=("Amanda server VM name")) Params.add_option( "--ceph_auth_user", "--ceph-auth-user", default="admin", help=("Ceph user"))
# Mount a volume import re, os.path, time from stack import Stack,Mount from layers import Layer from params import Params # Mount parameters Params.add_option( "--no_auto_mount", "--no-auto-mount", help=("don't automatically try to automount the final device; " "mount must be specified explicitly")) class MountPartition(Layer,Mount): name = 'part' mount_cmd = '/bin/mount' umount_cmd = '/bin/umount' def __init__(self,arg_str,params,parent_layer): super(MountPartition,self).__init__(arg_str,params,parent_layer) self.mount_db = None def print_info(self): self.infomsg("Initialized mount object parameters:") # Don't print parent_device; this invokes unwanted mdadm runs
# Base Layer class and Snapper subclass import sys, os.path, pickle from datetime import datetime, timedelta from pprint import pformat from util import Util from params import Params # Snapshot parameters Params.add_option( "--stale_seconds", "--stale-seconds", type="int", required_param=True, interesting_param=True, help=("number of seconds before a snapshot is considered stale")) Params.add_option( "--size", interesting_param=True, help=("size of snapshot; see lvcreate(8) for units")) Params.add_option( "--snaplayers_state_file", "--snaplayers-state-file", default='/var/lib/amanda/snaplayers.db', help=("location of snaplayers state file")) Params.add_option( "--snap_suffix", "--snap-suffix", default='.amsnap', help=("snapshot suffix")) class Snapdb(dict): '''