Skip to content

Commit 294f4df

Browse files
committed
Updated examples
1 parent e221ce0 commit 294f4df

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

README.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
OCA - OpenNebula Cloud Api
33
##############################################
44

5-
:Version: 0.1
5+
:Version: 0.2
66

77
About
88
-----
@@ -24,10 +24,7 @@ Allocating new host::
2424
new_host_id = oca.Host.allocate(client, 'host_name', 'im_xen', 'vmm_xen', 'tm_nfs')
2525
hostpool = oca.HostPool(client)
2626
hostpool.info()
27-
for i in hostpool:
28-
if i.id == new_host_id:
29-
vm = i
30-
break
27+
vm = hostpool.get_by_id(new_host_id)
3128
print vm.name, vm.str_state
3229

3330
License

docs/user_guide.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ Allocating new host::
1010
new_host_id = oca.Host.allocate(client, 'host_name', 'im_xen', 'vmm_xen', 'tm_nfs')
1111
hostpool = oca.HostPool(client)
1212
hostpool.info()
13-
for i in hostpool:
14-
if i.id == new_host_id:
15-
vm = i
16-
break
13+
vm = hostpool.get_by_id(new_host_id)
1714
print vm.name, vm.str_state
1815

1916

0 commit comments

Comments
 (0)