當前位置: 首頁>>代碼示例>>Python>>正文


Python Params.add_option方法代碼示例

本文整理匯總了Python中params.Params.add_option方法的典型用法代碼示例。如果您正苦於以下問題:Python Params.add_option方法的具體用法?Python Params.add_option怎麽用?Python Params.add_option使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在params.Params的用法示例。


在下文中一共展示了Params.add_option方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1:

# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import add_option [as 別名]
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"))
開發者ID:zultron,項目名稱:amanda-snapshot-layers,代碼行數:34,代碼來源:layer_libvirt.py

示例2: MountPartition

# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import add_option [as 別名]
# 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
開發者ID:zultron,項目名稱:amanda-snapshot-layers,代碼行數:33,代碼來源:layer_mount_partition.py

示例3: lvcreate

# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import add_option [as 別名]
# 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):
    '''
開發者ID:zultron,項目名稱:amanda-snapshot-layers,代碼行數:33,代碼來源:layers.py


注:本文中的params.Params.add_option方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。