Skip to content

Commit 1fa3e19

Browse files
committed
revert: remove incorrect LRO handling changes in custom.py and put_mc
Revert changes to aks_enable_addons, aks_disable_addons and put_mc that added explicit LongRunningOperation calls. The stable CLI uses sdk_no_wait pattern consistently and the CLI framework handles LRO poller resolution automatically for supports_no_wait commands.
1 parent 6e65cf8 commit 1fa3e19

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,10 +3032,7 @@ def aks_disable_addons(cmd, client, resource_group_name, name, addons, no_wait=F
30323032
)
30333033

30343034
# send the managed cluster representation to update the addon profiles
3035-
if no_wait:
3036-
return sdk_no_wait(True, client.begin_create_or_update, resource_group_name, name, instance)
3037-
return LongRunningOperation(cmd.cli_ctx)(
3038-
client.begin_create_or_update(resource_group_name, name, instance))
3035+
return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, name, instance)
30393036

30403037

30413038
def aks_enable_addons(
@@ -3192,12 +3189,8 @@ def aks_enable_addons(
31923189
# we don't need to handle it in client side in this case.
31933190

31943191
else:
3195-
if no_wait:
3196-
result = sdk_no_wait(True, client.begin_create_or_update,
3197-
resource_group_name, name, instance, headers=headers)
3198-
else:
3199-
result = LongRunningOperation(cmd.cli_ctx)(
3200-
client.begin_create_or_update(resource_group_name, name, instance, headers=headers))
3192+
result = sdk_no_wait(no_wait, client.begin_create_or_update,
3193+
resource_group_name, name, instance, headers=headers)
32013194
return result
32023195

32033196

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7791,9 +7791,9 @@ def put_mc(self, mc: ManagedCluster) -> ManagedCluster:
77917791
# poll until the result is returned
77927792
cluster = LongRunningOperation(self.cmd.cli_ctx)(poller)
77937793
self.postprocessing_after_mc_created(cluster)
7794-
elif self.context.get_no_wait():
7794+
else:
77957795
cluster = sdk_no_wait(
7796-
True,
7796+
self.context.get_no_wait(),
77977797
self.client.begin_create_or_update,
77987798
resource_group_name=self.context.get_resource_group_name(),
77997799
resource_name=self.context.get_name(),
@@ -7802,15 +7802,5 @@ def put_mc(self, mc: ManagedCluster) -> ManagedCluster:
78027802
if_none_match=self.context.get_if_none_match(),
78037803
headers=self.context.get_aks_custom_headers(),
78047804
)
7805-
else:
7806-
poller = self.client.begin_create_or_update(
7807-
resource_group_name=self.context.get_resource_group_name(),
7808-
resource_name=self.context.get_name(),
7809-
parameters=mc,
7810-
if_match=self.context.get_if_match(),
7811-
if_none_match=self.context.get_if_none_match(),
7812-
headers=self.context.get_aks_custom_headers(),
7813-
)
7814-
cluster = LongRunningOperation(self.cmd.cli_ctx)(poller)
78157805

78167806
return cluster

0 commit comments

Comments
 (0)