当前位置: 首页>>代码示例>>Python>>正文


Python Sandbox.get_sandboxtype方法代码示例

本文整理汇总了Python中sandbox.Sandbox.get_sandboxtype方法的典型用法代码示例。如果您正苦于以下问题:Python Sandbox.get_sandboxtype方法的具体用法?Python Sandbox.get_sandboxtype怎么用?Python Sandbox.get_sandboxtype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sandbox.Sandbox的用法示例。


在下文中一共展示了Sandbox.get_sandboxtype方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from sandbox import Sandbox [as 别名]
# 或者: from sandbox.Sandbox import get_sandboxtype [as 别名]

#.........这里部分代码省略.........
                del argv[i]
        for i, arg in enumerate(argv):       
            if arg == '--user':
                user = argv[i + 1]
                del argv[i]
                del argv[i]
        for i, arg in enumerate(argv):                
            if arg == '--passwd' or arg == '--password':
                passwd = argv[i + 1]
                del argv[i]
                del argv[i]

        for i, arg in enumerate(argv):
            if arg == '--release':
                release = argv[i + 1]
                del argv[i]
                del argv[i]
        for i, arg in enumerate(argv):
            if arg == '--branding':
                branding = argv[i + 1]
                del argv[i]
                del argv[i]
        for i, arg in enumerate(argv):
            if arg == '--repo':
                repo = argv[i + 1]
                del argv[i]
                del argv[i]
                
        if global_vars.ea and ip and user and passwd:
            setup.setSetupFile()
            setup.configAppliance(global_vars.ea, ip, user, passwd)
      
        #make sure we're creating a new PSA if an appliance sandbox type is being used
        if 'appliance' in sb.get_sandboxtype().get_variant():
            global_vars.ea = 'sb-test-appliance'
            if '--recreate-psa' not in argv and global_vars.ea in isetup.getAppliances():
                argv.append('--recreate-psa')
        isetup.setSetupFile()
        
        #create the appliance if the appliance doesn't exist in the setup file
        if global_vars.ea and global_vars.ea not in isetup.getAppliances():
            ansi.printc('Appliance %s does not exist, will attempt to create it in 5 seconds, push ctrl+c to cancel' % global_vars.ea, colors.WARNING_COLOR)
            time.sleep(5)
            ip = controlVM.createPSA(global_vars.ea, branding, release, repo)
            isetup.setAppliance(global_vars.ea, ip, 'root', 'psa')
        if '--recreate-psa' in argv:
            assert global_vars.ea, 'A VM must be specified with the --ea option to use the --recreate-psa option'
            controlVM.createPSA(global_vars.ea, branding, release, repo)
            argv.remove('--recreate-psa')
            

        # Support "modes" of tests. This allows us to run a set of tests in
        # more than one way -- for example, with valgrind enabled or disabled,
        # or with SearchServer using hs5 versus hs3.
        mode_path = os.path.join(sb.get_root(), _MODE_FILE)
        argv, modes = get_modes(argv)
        if os.path.isfile(mode_path):
            os.remove(mode_path)
        if modes:
            if modes[0].lower() != 'none':
                with open(mode_path, 'w') as f:
                    f.write(','.join(modes))

        attr_arg = find_attr_arg_index(argv)
        if len(modes) == 0 and attr_arg is None:
            modeattrs = sb.get_sandboxtype().get_test_mode_attrs_combo()
开发者ID:perfectsearch,项目名称:sandman,代码行数:70,代码来源:test.py


注:本文中的sandbox.Sandbox.get_sandboxtype方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。