Hello community,

here is the log from the commit of package azure-cli-cloud for openSUSE:Factory 
checked in at 2018-02-14 09:30:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-cloud (Old)
 and      /work/SRC/openSUSE:Factory/.azure-cli-cloud.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "azure-cli-cloud"

Wed Feb 14 09:30:06 2018 rev:2 rq:574800 version:2.0.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/azure-cli-cloud/azure-cli-cloud.changes  
2017-11-10 14:52:48.290044199 +0100
+++ /work/SRC/openSUSE:Factory/.azure-cli-cloud.new/azure-cli-cloud.changes     
2018-02-14 09:30:12.866540298 +0100
@@ -1,0 +2,9 @@
+Wed Feb  7 14:58:55 UTC 2018 - adrian.glaub...@suse.com
+
+- New upstream release
+  + Version 2.0.12
+  + For detailed information about changes see the
+    HISTORY.rst file provided with this package
+- Install HISTORY.rst into doc directory
+
+-------------------------------------------------------------------

Old:
----
  azure-cli-cloud-2.0.8.tar.gz

New:
----
  azure-cli-cloud-2.0.12.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ azure-cli-cloud.spec ++++++
--- /var/tmp/diff_new_pack.zNDp2Y/_old  2018-02-14 09:30:14.122494786 +0100
+++ /var/tmp/diff_new_pack.zNDp2Y/_new  2018-02-14 09:30:14.126494642 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package azure-cli-cloud
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,8 +15,9 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           azure-cli-cloud
-Version:        2.0.8
+Version:        2.0.12
 Release:        0
 Summary:        Microsoft Azure CLI 'cloud' Command Module
 License:        MIT
@@ -24,16 +25,16 @@
 Url:            https://github.com/Azure/azure-cli
 Source:         
https://files.pythonhosted.org/packages/source/a/azure-cli-cloud/azure-cli-cloud-%{version}.tar.gz
 Source1:        LICENSE.txt
-BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
-BuildRequires:  unzip
 BuildRequires:  azure-cli-command-modules-nspkg
 BuildRequires:  azure-cli-nspkg
 BuildRequires:  python3-azure-nspkg
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  unzip
 Requires:       azure-cli-command-modules-nspkg
+Requires:       azure-cli-core
 Requires:       azure-cli-nspkg
 Requires:       python3-azure-nspkg
-Requires:       azure-cli-core
 Conflicts:      azure-cli < 2.0.0
 
 BuildArch:      noarch
@@ -62,7 +63,8 @@
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE.txt README.rst
+%doc HISTORY.rst LICENSE.txt README.rst
 %{python3_sitelib}/azure/cli/command_modules/cloud
 %{python3_sitelib}/azure_cli_cloud-*.egg-info
+
 %changelog

++++++ azure-cli-cloud-2.0.8.tar.gz -> azure-cli-cloud-2.0.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-cloud-2.0.8/HISTORY.rst 
new/azure-cli-cloud-2.0.12/HISTORY.rst
--- old/azure-cli-cloud-2.0.8/HISTORY.rst       2017-09-23 01:47:00.000000000 
+0200
+++ new/azure-cli-cloud-2.0.12/HISTORY.rst      2018-01-26 17:12:23.000000000 
+0100
@@ -2,6 +2,23 @@
 
 Release History
 ===============
+
+2.0.12
+++++++
+* Performance fixes.
+
+2.0.11
+++++++
+* Bug fix: Do not require endpoints to be specified when setting --profile for 
a cloud.
+
+2.0.10
+++++++
+* `az cloud register` & `az cloud update`: Prevent users from registering 
clouds that have missing required endpoints
+
+2.0.9
++++++
+* minor fixes
+
 2.0.8 (2017-09-22)
 ++++++++++++++++++
 * minor fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-cloud-2.0.8/PKG-INFO 
new/azure-cli-cloud-2.0.12/PKG-INFO
--- old/azure-cli-cloud-2.0.8/PKG-INFO  2017-09-23 01:48:16.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/PKG-INFO 2018-01-26 17:12:48.000000000 +0100
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: azure-cli-cloud
-Version: 2.0.8
+Version: 2.0.12
 Summary: Microsoft Azure Command-Line Tools Cloud Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
 Author-email: azpy...@microsoft.com
 License: MIT
-Description-Content-Type: UNKNOWN
 Description: Microsoft Azure CLI 'cloud' Command Module
         ==========================================
         
@@ -17,6 +16,23 @@
         
         Release History
         ===============
+        
+        2.0.12
+        ++++++
+        * Performance fixes.
+        
+        2.0.11
+        ++++++
+        * Bug fix: Do not require endpoints to be specified when setting 
--profile for a cloud.
+        
+        2.0.10
+        ++++++
+        * `az cloud register` & `az cloud update`: Prevent users from 
registering clouds that have missing required endpoints
+        
+        2.0.9
+        +++++
+        * minor fixes
+        
         2.0.8 (2017-09-22)
         ++++++++++++++++++
         * minor fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/__init__.py 
new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/__init__.py
--- old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/__init__.py       
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/__init__.py      
2018-01-26 17:12:23.000000000 +0100
@@ -3,12 +3,75 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
+from azure.cli.core import AzCommandsLoader
+from azure.cli.core.util import shell_safe_json_parse
+from azure.cli.core.profiles import API_PROFILES
+from azure.cli.core.commands import CliCommandType
+
+from azure.cli.command_modules.cloud._completers import (
+    get_cloud_name_completion_list, get_custom_cloud_name_completion_list)
 import azure.cli.command_modules.cloud._help  # pylint: disable=unused-import
 
 
-def load_params(_):
-    import azure.cli.command_modules.cloud._params  # pylint: 
disable=redefined-outer-name, unused-variable
+class CloudCommandsLoader(AzCommandsLoader):
+
+    def __init__(self, cli_ctx=None):
+        super(CloudCommandsLoader, self).__init__(cli_ctx=cli_ctx)
+
+    def load_command_table(self, args):
+
+        cloud_custom = 
CliCommandType(operations_tmpl='azure.cli.command_modules.cloud.custom#{}')
+
+        with self.command_group('cloud', cloud_custom) as g:
+            g.command('list', 'list_clouds')
+            g.command('show', 'show_cloud')
+            g.command('register', 'register_cloud')
+            g.command('unregister', 'unregister_cloud')
+            g.command('set', 'set_cloud')
+            g.command('update', 'modify_cloud')
+            g.command('list-profiles', 'list_profiles')
+
+        return self.command_table
+
+    def load_arguments(self, command):
+
+        active_cloud_name = self.cli_ctx.cloud.name
+
+        # pylint: disable=line-too-long
+        with self.argument_context('cloud') as c:
+            c.argument('cloud_name', options_list=('--name', '-n'), help='Name 
of a registered cloud', completer=get_cloud_name_completion_list)
+            c.argument('profile', help='Profile to use for this cloud', 
choices=list(API_PROFILES))
+            c.argument('cloud_config', options_list=('--cloud-config',), 
help='JSON encoded cloud configuration. Use @{file} to load from a file.', 
type=shell_safe_json_parse)
+            c.argument('endpoint_management', help='The management service 
endpoint')
+            c.argument('endpoint_resource_manager', help='The resource 
management endpoint')
+            c.argument('endpoint_sql_management', help='The sql server 
management endpoint')
+            c.argument('endpoint_gallery', help='The template gallery 
endpoint')
+            c.argument('endpoint_active_directory', help='The Active Directory 
login endpoint')
+            c.argument('endpoint_active_directory_resource_id', help='The 
resource ID to obtain AD tokens for')
+            c.argument('endpoint_active_directory_graph_resource_id', 
help='The Active Directory resource ID')
+            c.argument('endpoint_active_directory_data_lake_resource_id', 
help='The Active Directory resource ID for data lake services')
+            c.argument('endpoint_vm_image_alias_doc', help='The uri of the 
document which caches commonly used virtual machine images')
+            c.argument('suffix_sql_server_hostname', help='The dns suffix for 
sql servers')
+            c.argument('suffix_storage_endpoint', help='The endpoint suffix 
for storage accounts')
+            c.argument('suffix_keyvault_dns', help='The Key Vault service dns 
suffix')
+            c.argument('suffix_azure_datalake_store_file_system_endpoint', 
help='The Data Lake store filesystem service dns suffix')
+            
c.argument('suffix_azure_datalake_analytics_catalog_and_job_endpoint', 
help='The Data Lake analytics job and catalog service dns suffix')
+
+        with self.argument_context('cloud show') as c:
+            c.argument('cloud_name', help='Name of a registered cloud.', 
default=active_cloud_name)
+
+        with self.argument_context('cloud update') as c:
+            c.argument('cloud_name', help='Name of a registered cloud.', 
default=active_cloud_name)
+
+        with self.argument_context('cloud list-profiles') as c:
+            c.argument('cloud_name', help='Name of a registered cloud.', 
default=active_cloud_name)
+            c.argument('show_all', help='Show all available profiles supported 
in the CLI.', action='store_true')
+
+        with self.argument_context('cloud register') as c:
+            c.argument('cloud_name', completer=None)
+
+        with self.argument_context('cloud unregister') as c:
+            c.argument('cloud_name', 
completer=get_custom_cloud_name_completion_list)
 
 
-def load_commands():
-    import azure.cli.command_modules.cloud.commands  # pylint: 
disable=redefined-outer-name, unused-variable
+COMMAND_LOADER_CLS = CloudCommandsLoader
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/_completers.py 
new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/_completers.py
--- old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/_completers.py    
1970-01-01 01:00:00.000000000 +0100
+++ new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/_completers.py   
2018-01-26 17:12:23.000000000 +0100
@@ -0,0 +1,19 @@
+# 
--------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 
license information.
+# 
--------------------------------------------------------------------------------------------
+
+from azure.cli.core.cloud import get_custom_clouds
+from azure.cli.core.decorators import Completer
+
+from azure.cli.command_modules.cloud.custom import get_clouds
+
+
+@Completer
+def get_cloud_name_completion_list(cmd, prefix, namespace, **kwargs):  # 
pylint: disable=unused-argument
+    return [c.name for c in get_clouds(cmd.cli_ctx)]
+
+
+@Completer
+def get_custom_cloud_name_completion_list(cmd, prefix, namespace, **kwargs):  
# pylint: disable=unused-argument
+    return [c.name for c in get_custom_clouds(cmd.cli_ctx)]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/_help.py 
new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/_help.py
--- old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/_help.py  
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/_help.py 
2018-01-26 17:12:23.000000000 +0100
@@ -3,7 +3,7 @@
 # Licensed under the MIT License. See License.txt in the project root for 
license information.
 # 
--------------------------------------------------------------------------------------------
 
-from azure.cli.core.help_files import helps  # pylint: disable=unused-import
+from knack.help_files import helps  # pylint: disable=unused-import
 
 
 helps['cloud'] = """
@@ -22,19 +22,19 @@
 """
 
 helps['cloud register'] = """
-            type: command
-            short-summary: Register a cloud.
-            long-summary: When registering a cloud, specify only the resource 
manager endpoint for the autodetection of other endpoints.
+    type: command
+    short-summary: Register a cloud.
+    long-summary: When registering a cloud, specify only the resource manager 
endpoint for the autodetection of other endpoints.
 """
 
 helps['cloud unregister'] = """
-            type: command
-            short-summary: Unregister a cloud.
+    type: command
+    short-summary: Unregister a cloud.
 """
 
 helps['cloud set'] = """
-            type: command
-            short-summary: Set the active cloud.
+    type: command
+    short-summary: Set the active cloud.
 """
 
 helps['cloud update'] = """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/_params.py 
new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/_params.py
--- old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/_params.py        
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/_params.py       
1970-01-01 01:00:00.000000000 +0100
@@ -1,76 +0,0 @@
-# 
--------------------------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for 
license information.
-# 
--------------------------------------------------------------------------------------------
-
-from azure.cli.core.commands import register_cli_argument
-from azure.cli.core.util import shell_safe_json_parse
-from azure.cli.core.cloud import get_clouds, get_custom_clouds, 
get_active_cloud_name
-
-from azure.cli.core.profiles import API_PROFILES
-
-
-def get_cloud_name_completion_list(prefix, action, parsed_args, **kwargs):  # 
pylint: disable=unused-argument
-    return [c.name for c in get_clouds()]
-
-
-def get_custom_cloud_name_completion_list(prefix, action, parsed_args, 
**kwargs):  # pylint: disable=unused-argument
-    return [c.name for c in get_custom_clouds()]
-
-
-active_cloud_name = get_active_cloud_name()
-
-register_cli_argument('cloud', 'cloud_name', options_list=('--name', '-n'),
-                      help='Name of a registered cloud',
-                      completer=get_cloud_name_completion_list)
-
-register_cli_argument('cloud show', 'cloud_name',
-                      help='Name of a registered cloud.', 
default=active_cloud_name)
-register_cli_argument('cloud update', 'cloud_name',
-                      help='Name of a registered cloud.', 
default=active_cloud_name)
-register_cli_argument('cloud list-profiles', 'cloud_name',
-                      help='Name of a registered cloud.', 
default=active_cloud_name)
-register_cli_argument('cloud list-profiles', 'show_all',
-                      help='Show all available profiles supported in the 
CLI.', action='store_true')
-
-register_cli_argument('cloud register', 'cloud_name', completer=None)
-
-register_cli_argument('cloud unregister', 'cloud_name',
-                      completer=get_custom_cloud_name_completion_list)
-
-register_cli_argument('cloud', 'profile',
-                      help='Profile to use for this cloud',
-                      choices=list(API_PROFILES))
-
-register_cli_argument('cloud', 'cloud_config', 
options_list=('--cloud-config',),
-                      help='JSON encoded cloud configuration. Use @{file} to 
load from a file.',
-                      type=shell_safe_json_parse)
-
-register_cli_argument('cloud', 'endpoint_management',
-                      help='The management service endpoint')
-register_cli_argument('cloud', 'endpoint_resource_manager',
-                      help='The resource management endpoint')
-register_cli_argument('cloud', 'endpoint_sql_management',
-                      help='The sql server management endpoint')
-register_cli_argument('cloud', 'endpoint_gallery',
-                      help='The template gallery endpoint')
-register_cli_argument('cloud', 'endpoint_active_directory',
-                      help='The Active Directory login endpoint')
-register_cli_argument('cloud', 'endpoint_active_directory_resource_id',
-                      help='The resource ID to obtain AD tokens for')
-register_cli_argument('cloud', 'endpoint_active_directory_graph_resource_id',
-                      help='The Active Directory resource ID')
-register_cli_argument('cloud', 
'endpoint_active_directory_data_lake_resource_id',
-                      help='The Active Directory resource ID for data lake 
services')
-register_cli_argument('cloud', 'endpoint_vm_image_alias_doc',
-                      help='The uri of the document which caches commonly used 
virtual machine images')
-register_cli_argument('cloud', 'suffix_sql_server_hostname',
-                      help='The dns suffix for sql servers')
-register_cli_argument('cloud', 'suffix_storage_endpoint',
-                      help='The endpoint suffix for storage accounts')
-register_cli_argument('cloud', 'suffix_keyvault_dns',
-                      help='The Key Vault service dns suffix')
-register_cli_argument('cloud', 
'suffix_azure_datalake_store_file_system_endpoint',
-                      help='The Data Lake store filesystem service dns suffix')
-register_cli_argument('cloud', 
'suffix_azure_datalake_analytics_catalog_and_job_endpoint',
-                      help='The Data Lake analytics job and catalog service 
dns suffix')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/commands.py 
new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/commands.py
--- old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/commands.py       
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/commands.py      
1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-# 
--------------------------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for 
license information.
-# 
--------------------------------------------------------------------------------------------
-
-from azure.cli.core.commands import cli_command
-
-cli_command(__name__, 'cloud list', 
'azure.cli.command_modules.cloud.custom#list_clouds')
-cli_command(__name__, 'cloud show', 
'azure.cli.command_modules.cloud.custom#show_cloud')
-cli_command(__name__, 'cloud register', 
'azure.cli.command_modules.cloud.custom#register_cloud')
-cli_command(__name__, 'cloud unregister', 
'azure.cli.command_modules.cloud.custom#unregister_cloud')
-cli_command(__name__, 'cloud set', 
'azure.cli.command_modules.cloud.custom#set_cloud')
-cli_command(__name__, 'cloud update', 
'azure.cli.command_modules.cloud.custom#modify_cloud')
-cli_command(__name__, 'cloud list-profiles', 
'azure.cli.command_modules.cloud.custom#list_profiles')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/custom.py 
new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/custom.py
--- old/azure-cli-cloud-2.0.8/azure/cli/command_modules/cloud/custom.py 
2017-09-23 01:47:00.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure/cli/command_modules/cloud/custom.py        
2018-01-26 17:12:23.000000000 +0100
@@ -4,7 +4,7 @@
 # 
--------------------------------------------------------------------------------------------
 
 # pylint: disable=unused-argument
-from azure.cli.core.util import CLIError, to_snake_case
+from knack.util import CLIError, to_snake_case
 
 from azure.cli.core.cloud import (Cloud,
                                   get_clouds,
@@ -14,60 +14,28 @@
                                   switch_active_cloud,
                                   update_cloud,
                                   get_active_cloud_name,
+                                  cloud_is_registered,
                                   CloudAlreadyRegisteredException,
                                   CloudNotRegisteredException,
                                   CannotUnregisterCloudException)
 
 
-# The exact API version doesn't matter too much right now. It just has to be 
YYYY-MM-DD format.
-METADATA_ENDPOINT_SUFFIX = '/metadata/endpoints?api-version=2015-01-01'
+def list_clouds(cmd):
+    return get_clouds(cmd.cli_ctx)
 
 
-def list_clouds():
-    return get_clouds()
-
-
-def show_cloud(cloud_name=None):
+def show_cloud(cmd, cloud_name=None):
     if not cloud_name:
-        cloud_name = get_active_cloud_name()
+        cloud_name = cmd.cli_ctx.cloud.name
     try:
-        return get_cloud(cloud_name)
+        return get_cloud(cmd.cli_ctx, cloud_name)
     except CloudNotRegisteredException as e:
         raise CLIError(e)
 
 
-def _populate_from_metadata_endpoint(cloud, arm_endpoint):
-    endpoints_in_metadata = ['active_directory_graph_resource_id',
-                             'active_directory_resource_id', 
'active_directory']
-    if not arm_endpoint or all([cloud.endpoints.has_endpoint_set(n) for n in 
endpoints_in_metadata]):
-        return
-    try:
-        error_msg_fmt = "Unable to get endpoints from the cloud.\n{}"
-        import requests
-        metadata_endpoint = arm_endpoint + METADATA_ENDPOINT_SUFFIX
-        response = requests.get(metadata_endpoint)
-        if response.status_code == 200:
-            metadata = response.json()
-            if not cloud.endpoints.has_endpoint_set('gallery'):
-                setattr(cloud.endpoints, 'gallery', 
metadata.get('galleryEndpoint'))
-            if not 
cloud.endpoints.has_endpoint_set('active_directory_graph_resource_id'):
-                setattr(cloud.endpoints, 'active_directory_graph_resource_id', 
metadata.get('graphEndpoint'))
-            if not cloud.endpoints.has_endpoint_set('active_directory'):
-                setattr(cloud.endpoints, 'active_directory', 
metadata['authentication'].get('loginEndpoint'))
-            if not 
cloud.endpoints.has_endpoint_set('active_directory_resource_id'):
-                setattr(cloud.endpoints, 'active_directory_resource_id', 
metadata['authentication']['audiences'][0])
-        else:
-            msg = 'Server returned status code {} for 
{}'.format(response.status_code, metadata_endpoint)
-            raise CLIError(error_msg_fmt.format(msg))
-    except (requests.exceptions.ConnectionError, 
requests.exceptions.HTTPError) as err:
-        msg = 'Please ensure you have network connection. Error detail: 
{}'.format(str(err))
-        raise CLIError(error_msg_fmt.format(msg))
-    except ValueError as err:
-        msg = 'Response body does not contain valid json. Error detail: 
{}'.format(str(err))
-        raise CLIError(error_msg_fmt.format(msg))
+def _build_cloud(cli_ctx, cloud_name, cloud_config=None, cloud_args=None):
+    from msrestazure.azure_cloud import _populate_from_metadata_endpoint, 
MetadataEndpointError
 
-
-def _build_cloud(cloud_name, cloud_config=None, cloud_args=None):
     if cloud_config:
         # Using JSON format so convert the keys to snake case
         for key in cloud_config:
@@ -81,11 +49,26 @@
         elif arg.startswith('suffix_') and cloud_args[arg] is not None:
             setattr(c.suffixes, arg.replace('suffix_', ''), cloud_args[arg])
     arm_endpoint = cloud_args.get('endpoint_resource_manager', None)
-    _populate_from_metadata_endpoint(c, arm_endpoint)
+    try:
+        _populate_from_metadata_endpoint(c, arm_endpoint)
+    except MetadataEndpointError as err:
+        raise CLIError(err)
+    required_endpoints = {'resource_manager': '--endpoint-resource-manager',
+                          'active_directory': '--endpoint-active-directory',
+                          'active_directory_resource_id': 
'--endpoint-active-directory-resource-id',
+                          'active_directory_graph_resource_id': 
'--endpoint-active-directory-graph-resource-id'}
+    missing_endpoints = [e_param for e_name, e_param in 
required_endpoints.items()
+                         if not c.endpoints.has_endpoint_set(e_name)]
+    if missing_endpoints and not cloud_is_registered(cli_ctx, cloud_name):
+        raise CLIError("The following endpoints are required for the CLI to 
function and were not specified on the "
+                       "command line, in the cloud config or could not be 
autodetected.\n"
+                       "Specify them on the command line or through the cloud 
config file:\n"
+                       "{}".format(', '.join(missing_endpoints)))
     return c
 
 
-def register_cloud(cloud_name,
+def register_cloud(cmd,
+                   cloud_name,
                    cloud_config=None,
                    profile=None,
                    endpoint_management=None,
@@ -102,15 +85,16 @@
                    suffix_keyvault_dns=None,
                    suffix_azure_datalake_store_file_system_endpoint=None,
                    
suffix_azure_datalake_analytics_catalog_and_job_endpoint=None):
-    c = _build_cloud(cloud_name, cloud_config=cloud_config,
+    c = _build_cloud(cmd.cli_ctx, cloud_name, cloud_config=cloud_config,
                      cloud_args=locals())
     try:
-        add_cloud(c)
+        add_cloud(cmd.cli_ctx, c)
     except CloudAlreadyRegisteredException as e:
         raise CLIError(e)
 
 
-def modify_cloud(cloud_name=None,
+def modify_cloud(cmd,
+                 cloud_name=None,
                  cloud_config=None,
                  profile=None,
                  endpoint_management=None,
@@ -128,35 +112,35 @@
                  suffix_azure_datalake_store_file_system_endpoint=None,
                  
suffix_azure_datalake_analytics_catalog_and_job_endpoint=None):
     if not cloud_name:
-        cloud_name = get_active_cloud_name()
-    c = _build_cloud(cloud_name, cloud_config=cloud_config,
+        cloud_name = cmd.cli_ctx.cloud.name
+    c = _build_cloud(cmd.cli_ctx, cloud_name, cloud_config=cloud_config,
                      cloud_args=locals())
     try:
-        update_cloud(c)
+        update_cloud(cmd.cli_ctx, c)
     except CloudNotRegisteredException as e:
         raise CLIError(e)
 
 
-def unregister_cloud(cloud_name):
+def unregister_cloud(cmd, cloud_name):
     try:
-        return remove_cloud(cloud_name)
+        return remove_cloud(cmd.cli_ctx, cloud_name)
     except CloudNotRegisteredException as e:
         raise CLIError(e)
     except CannotUnregisterCloudException as e:
         raise CLIError(e)
 
 
-def set_cloud(cloud_name, profile=None):
+def set_cloud(cmd, cloud_name, profile=None):
     try:
-        switch_active_cloud(cloud_name)
+        switch_active_cloud(cmd.cli_ctx, cloud_name)
         if profile:
-            modify_cloud(cloud_name=cloud_name, profile=profile)
+            modify_cloud(cmd, cloud_name=cloud_name, profile=profile)
     except CloudNotRegisteredException as e:
         raise CLIError(e)
 
 
-def list_profiles(cloud_name=None, show_all=False):
+def list_profiles(cmd, cloud_name=None, show_all=False):
     from azure.cli.core.profiles import API_PROFILES
     if not cloud_name:
-        cloud_name = get_active_cloud_name()
+        cloud_name = get_active_cloud_name(cmd.cli_ctx.cloud)
     return list(API_PROFILES)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure_cli_cloud.egg-info/PKG-INFO 
new/azure-cli-cloud-2.0.12/azure_cli_cloud.egg-info/PKG-INFO
--- old/azure-cli-cloud-2.0.8/azure_cli_cloud.egg-info/PKG-INFO 2017-09-23 
01:48:15.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure_cli_cloud.egg-info/PKG-INFO        
2018-01-26 17:12:48.000000000 +0100
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: azure-cli-cloud
-Version: 2.0.8
+Version: 2.0.12
 Summary: Microsoft Azure Command-Line Tools Cloud Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
 Author-email: azpy...@microsoft.com
 License: MIT
-Description-Content-Type: UNKNOWN
 Description: Microsoft Azure CLI 'cloud' Command Module
         ==========================================
         
@@ -17,6 +16,23 @@
         
         Release History
         ===============
+        
+        2.0.12
+        ++++++
+        * Performance fixes.
+        
+        2.0.11
+        ++++++
+        * Bug fix: Do not require endpoints to be specified when setting 
--profile for a cloud.
+        
+        2.0.10
+        ++++++
+        * `az cloud register` & `az cloud update`: Prevent users from 
registering clouds that have missing required endpoints
+        
+        2.0.9
+        +++++
+        * minor fixes
+        
         2.0.8 (2017-09-22)
         ++++++++++++++++++
         * minor fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure_cli_cloud.egg-info/SOURCES.txt 
new/azure-cli-cloud-2.0.12/azure_cli_cloud.egg-info/SOURCES.txt
--- old/azure-cli-cloud-2.0.8/azure_cli_cloud.egg-info/SOURCES.txt      
2017-09-23 01:48:15.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure_cli_cloud.egg-info/SOURCES.txt     
2018-01-26 17:12:48.000000000 +0100
@@ -7,9 +7,8 @@
 azure/cli/__init__.py
 azure/cli/command_modules/__init__.py
 azure/cli/command_modules/cloud/__init__.py
+azure/cli/command_modules/cloud/_completers.py
 azure/cli/command_modules/cloud/_help.py
-azure/cli/command_modules/cloud/_params.py
-azure/cli/command_modules/cloud/commands.py
 azure/cli/command_modules/cloud/custom.py
 azure_cli_cloud.egg-info/PKG-INFO
 azure_cli_cloud.egg-info/SOURCES.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-cloud-2.0.8/azure_cli_cloud.egg-info/requires.txt 
new/azure-cli-cloud-2.0.12/azure_cli_cloud.egg-info/requires.txt
--- old/azure-cli-cloud-2.0.8/azure_cli_cloud.egg-info/requires.txt     
2017-09-23 01:48:15.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/azure_cli_cloud.egg-info/requires.txt    
2018-01-26 17:12:48.000000000 +0100
@@ -1,2 +1 @@
 azure-cli-core
-azure-cli-command-modules-nspkg>=2.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-cloud-2.0.8/setup.py 
new/azure-cli-cloud-2.0.12/setup.py
--- old/azure-cli-cloud-2.0.8/setup.py  2017-09-23 01:48:15.000000000 +0200
+++ new/azure-cli-cloud-2.0.12/setup.py 2018-01-26 17:12:23.000000000 +0100
@@ -14,7 +14,7 @@
     logger.warn("Wheel is not available, disabling bdist_wheel hook")
     cmdclass = {}
 
-VERSION = "2.0.8"
+VERSION = "2.0.12"
 CLASSIFIERS = [
     'Development Status :: 5 - Production/Stable',
     'Intended Audience :: Developers',


Reply via email to