예제 #1
0
파일: custom.py 프로젝트: paulmey/azure-cli
def set_cloud(cloud_name, profile=None):
    try:
        switch_active_cloud(cloud_name)
        if profile:
            modify_cloud(cloud_name=cloud_name, profile=profile)
    except CloudNotRegisteredException as e:
        raise CLIError(e)
예제 #2
0
    def test_switch_active_cloud(self, subscription_setter):
        cli = mock.MagicMock()
        switch_active_cloud(cli, 'AzureGermanCloud')
        self.assertEqual(cli.cloud.name, 'AzureGermanCloud')

        switch_active_cloud(cli, 'AzureChinaCloud')
        self.assertEqual(cli.cloud.name, 'AzureChinaCloud')
예제 #3
0
    def test_switch_active_cloud(self, subscription_setter):
        cli = mock.MagicMock()
        switch_active_cloud(cli, 'AzureGermanCloud')
        self.assertEqual(cli.cloud.name, 'AzureGermanCloud')

        switch_active_cloud(cli, 'AzureChinaCloud')
        self.assertEqual(cli.cloud.name, 'AzureChinaCloud')
예제 #4
0
def set_cloud(cmd, cloud_name, profile=None):
    try:
        switch_active_cloud(cmd.cli_ctx, cloud_name)
        if profile:
            modify_cloud(cmd, cloud_name=cloud_name, profile=profile)
    except CloudNotRegisteredException as e:
        raise CLIError(e)
예제 #5
0
파일: custom.py 프로젝트: xscript/azure-cli
def set_cloud(cloud_name):
    try:
        switch_active_cloud(cloud_name)
    except CloudNotRegisteredException as e:
        raise CLIError(e)
예제 #6
0
def set_cloud(cloud_name):
    try:
        switch_active_cloud(cloud_name)
    except CloudNotRegisteredException as e:
        raise CLIError(e)