- List domains: #virsh list --all
- Undefine domains: #virst undefine <domain-name>
- List all volumes in pool 'default': #virsh vol-list default
| def color_red(): | |
| return 'I am red' | |
| def color_green(): | |
| return 'I am green' | |
| def color_blue(): | |
| return 'I am blue' |
| ''' Demo script experimenting with various features of the | |
| inspect module | |
| ''' | |
| # To be run with Python3.3 | |
| from inspect_test import MyClass | |
| from inspect_test import myfunc | |
| from inspect_test import mygen |
| Original array changes:: | |
| array('i', [1, 2, 3]) | |
| Object Identifier: 3075060736 | |
| Object Identifier: 3075060736 | |
| array('i', [1, 4, 9]) | |
| Original array doesn't change:: | |
| array('i', [1, 2, 3]) |
| + env PYTHONPATH=../Common:../Server:../LabController/proxy/src:../Client/src:../IntegrationTests/src nosetests -v rhts bkr | |
| Ensure Architectures field is parsed correctly ... ok | |
| Ensure that an Architectures field following a Releases field is parsed correctly ... ok | |
| Ensure a blank Bug field is handled ... ok | |
| Ensure that multiple Bug and Bugs lines work ... ok | |
| Ensure that multiple values for a Bugs field work ... ok | |
| Ensure a single Bug field works ... ok | |
| Ensure a single Bugs field works ... ok | |
| Ensure Description field is parsed correctly ... ok | |
| Ensure Description field containing a colon is parsed correctly ... ok |
| /* Demo of atexit in C | |
| http://www.gnu.org/software/libc/manual/html_node/Cleanups-on-Exit.html | |
| */ | |
| # include<stdio.h> | |
| void cleanup() | |
| { | |
| printf("Program terminated\n"); | |
| } |
| def purge_handlers(): | |
| #shutdown logging subsystem | |
| #Called during application exit or reinitialization, hence OK. | |
| logging.shutdown() | |
| #remove all handlers | |
| for (_, logger) in logging.root.manager.loggerDict.items(): | |
| if hasattr(logger, 'handlers'): | |
| for handler in logger.handlers: | |
| logger.removeHandler(handler) |
| # Copyright 2008 Lowell Alleman | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| # use this file except in compliance with the License. You may obtain a copy | |
| # of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
| # License for the specific language governing permissions and limitations |
| + env PYTHONPATH=../Common:../Server:../LabController/proxy/src:../Client/src:../IntegrationTests/src python -c '__requires__ = ["TurboGears"]; import pkg_resources; from nose.core import main; main()' -v rhts bkr | |
| Ensure Architectures field is parsed correctly ... ok | |
| Ensure that an Architectures field following a Releases field is parsed correctly ... ok | |
| Ensure a blank Bug field is handled ... ok | |
| Ensure that multiple Bug and Bugs lines work ... ok | |
| Ensure that multiple values for a Bugs field work ... ok | |
| Ensure a single Bug field works ... ok | |
| Ensure a single Bugs field works ... ok | |
| Ensure Description field is parsed correctly ... ok | |
| Ensure Description field containing a colon is parsed correctly ... ok |
| #!/usr/bin/env python | |
| """myfind | |
| Usage: | |
| myfind.py [--directory=<dir>] [--pattern=<p>] [--text=<text>] | |
| myfind.py -h | --help | |
| myfind.py --version | |
| Examples: |