Skip to content

Commit dc9aedb

Browse files
authored
Drop core for azure stack profiles (#31353)
1 parent df40099 commit dc9aedb

File tree

703 files changed

+1
-458516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

703 files changed

+1
-458516
lines changed

src/azure-cli/azure/cli/command_modules/network/__init__.py

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# --------------------------------------------------------------------------------------------
55

66
from azure.cli.core import AzCommandsLoader
7-
from azure.cli.core.profiles import ResourceType
87

98
import azure.cli.command_modules.network._help # pylint: disable=unused-import
109

@@ -51,77 +50,4 @@ def load_arguments(self, command):
5150
load_arguments(self, command)
5251

5352

54-
class AzureStackNetworkCommandsLoader(AzCommandsLoader):
55-
56-
def __init__(self, cli_ctx=None):
57-
from azure.cli.core import ModExtensionSuppress
58-
from azure.cli.core.commands import CliCommandType
59-
network_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.network.azure_stack.custom#{}')
60-
super().__init__(cli_ctx=cli_ctx,
61-
resource_type=ResourceType.MGMT_NETWORK,
62-
custom_command_type=network_custom,
63-
suppress_extension=[
64-
ModExtensionSuppress(__name__, 'dns', '0.0.2',
65-
reason='These commands are now in the CLI.',
66-
recommend_remove=True),
67-
ModExtensionSuppress(__name__, 'express-route', '0.1.3',
68-
reason='These commands are now in the CLI.',
69-
recommend_remove=True)
70-
])
71-
72-
def load_command_table(self, args):
73-
from azure.cli.core.aaz import load_aaz_command_table
74-
from azure.cli.command_modules.network.azure_stack.commands import load_command_table
75-
try:
76-
from . import aaz
77-
except ImportError:
78-
aaz = None
79-
80-
if aaz:
81-
profile = self.cli_ctx.cloud.profile
82-
try:
83-
if profile.lower() == "2019-03-01-hybrid":
84-
# use aaz in 2018-03-01-hybrid profile, because apis are the some.
85-
self.cli_ctx.cloud.profile = "2018-03-01-hybrid"
86-
load_aaz_command_table(
87-
loader=self,
88-
aaz_pkg_name=aaz.__name__,
89-
args=args
90-
)
91-
finally:
92-
self.cli_ctx.cloud.profile = profile
93-
94-
load_command_table(self, args)
95-
96-
profile = self.get_module_by_profile("commands")
97-
if profile and hasattr(profile, 'load_command_table'):
98-
profile.load_command_table(self, args)
99-
100-
return self.command_table
101-
102-
def load_arguments(self, command):
103-
from azure.cli.command_modules.network.azure_stack._params import load_arguments
104-
load_arguments(self, command)
105-
106-
profile = self.get_module_by_profile("_params")
107-
if profile and hasattr(profile, 'load_arguments'):
108-
profile.load_arguments(self, command)
109-
110-
def get_module_name_by_profile(self, module_name):
111-
from azure.cli.core.aaz.utils import get_aaz_profile_module_name
112-
profile_module_name = get_aaz_profile_module_name(profile_name=self.cli_ctx.cloud.profile)
113-
if module_name:
114-
return f'azure.cli.command_modules.network.azure_stack.{profile_module_name}.{module_name}'
115-
return f'azure.cli.command_modules.network.azure_stack.{profile_module_name}'
116-
117-
def get_module_by_profile(self, name):
118-
import importlib
119-
module_name = self.get_module_name_by_profile(name)
120-
return importlib.import_module(module_name)
121-
122-
123-
def get_command_loader(cli_ctx):
124-
if cli_ctx.cloud.profile.lower() != "latest":
125-
return AzureStackNetworkCommandsLoader
126-
127-
return NetworkCommandsLoader
53+
COMMAND_LOADER_CLS = NetworkCommandsLoader

src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/__init__.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__cmd_group.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__init__.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/_list_usages.py

Lines changed: 0 additions & 182 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__cmd_group.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)