Skip to content

Commit 83107c0

Browse files
committed
update the code structure for review
1 parent 280ca2e commit 83107c0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

articles/batch/batch-sig-images.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ You can also create a pool from a Shared Image using Python SDK.
132132
```python
133133
# Import the required modules from the
134134
# Azure Batch Client Library for Python
135-
import azure.batch._batch_service_client as batch
135+
import azure.batch as batch
136136
import azure.batch.models as batchmodels
137137
from azure.common.credentials import ServicePrincipalCredentials
138138

@@ -158,16 +158,19 @@ creds = ServicePrincipalCredentials(
158158
config = batch.BatchServiceClientConfiguration(creds, batch_url)
159159
client = batch.BatchServiceClient(creds, batch_url)
160160

161-
# Create the unbound pool
162-
new_pool = batchmodels.PoolAddParameter(id=pool_id, vm_size=vm_size)
163-
new_pool.target_dedicated = node_count
164-
165161
# Configure the start task for the pool
166162
start_task = batchmodels.StartTask(
167163
command_line="printenv AZ_BATCH_NODE_STARTUP_DIR"
168164
)
169165
start_task.run_elevated = True
170-
new_pool.start_task = start_task
166+
167+
# Create the unbound pool
168+
new_pool = batchmodels.PoolAddParameter(
169+
id=pool_id,
170+
vm_size=vm_size,
171+
target_dedicated_nodes=node_count,
172+
start_task=start_task
173+
)
171174

172175
# Create an ImageReference which specifies the image from
173176
# Shared Image Gallery to install on the nodes.

0 commit comments

Comments
 (0)