1# Copyright 2017 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5"""Obtain a lease file. 6 7This is used for testing leasing. 8""" 9 10from __future__ import absolute_import 11from __future__ import division 12from __future__ import print_function 13 14import logging 15import sys 16 17from lucifer import loglib 18from lucifer import leasing 19 20logger = logging.getLogger(__name__) 21 22 23def main(args): 24 """Main function 25 26 @param args: list of command line args 27 """ 28 loglib.configure_logging(name='obtain_lease') 29 with leasing.obtain_lease(args[0]) as path: 30 logger.debug('Obtained lease %s', path) 31 print('done') 32 raw_input() 33 logger.debug('Finishing successfully') 34 print('finish') 35 36 37if __name__ == '__main__': 38 sys.exit(main(sys.argv[1:])) 39