~hudson-openstack/nova/milestone-proposed

« back to all changes in this revision

Viewing changes to nova/virt/xenapi/fake.py

  • Committer: Tarmac
  • Author(s): Chris Behrens, Brian Lamar, Vishvananda Ishaya, vladimir.p, Nachi Ueno, Hisaharu Ishii, Tushar Patil, Dan Wendlandt, Dan Prince, Brian Waldon, Jesse Andrews, tagami.keisuke at co, Ken Pepple, Anthony Young, Thuleau Édouard, danwent at gmail, Mark McLoughlin, Ewan Mellor, Kevin L. Mitchell, kevin.mitchell at rackspace, Christopher MacGown, Tim Simpson, Soren Hansen, Brad Hall, Sandy Walsh, Trey Morris, Thierry Carrez, Keisuke Tagami, Launchpad Translations on behalf of nova-core, Josh Kearney
  • Date: 2011-09-09 09:52:51 UTC
  • mfrom: (1153.1.1 milestone-proposed)
  • Revision ID: tarmac-20110909095251-31hr8bbuc6oowalg
Merge diablo-RBP development up to rev 1541

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
"""
52
52
 
53
53
 
 
54
import random
54
55
import uuid
55
56
 
56
57
from pprint import pformat
103
104
 
104
105
def create_vm(name_label, status,
105
106
              is_a_template=False, is_control_domain=False):
 
107
    domid = status == 'Running' and random.randrange(1, 1 << 16) or -1
106
108
    return _create_object('VM',
107
109
                          {'name_label': name_label,
 
110
                           'domid': domid,
108
111
                           'power-state': status,
109
112
                           'is_a_template': is_a_template,
110
113
                           'is_control_domain': is_control_domain})