Hello community,

here is the log from the commit of package azure-cli-configure for 
openSUSE:Factory checked in at 2019-10-31 18:15:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-configure (Old)
 and      /work/SRC/openSUSE:Factory/.azure-cli-configure.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "azure-cli-configure"

Thu Oct 31 18:15:33 2019 rev:7 rq:742680 version:2.0.24

Changes:
--------
--- /work/SRC/openSUSE:Factory/azure-cli-configure/azure-cli-configure.changes  
2019-06-05 11:42:31.679050602 +0200
+++ 
/work/SRC/openSUSE:Factory/.azure-cli-configure.new.2990/azure-cli-configure.changes
        2019-10-31 18:15:34.706030585 +0100
@@ -1,0 +2,8 @@
+Thu Oct 24 12:09:31 UTC 2019 - John Paul Adrian Glaubitz 
<[email protected]>
+
+- New upstream release
+  + Version 2.0.24
+  + For detailed information about changes see the
+    HISTORY.txt file provided with this package
+
+-------------------------------------------------------------------

Old:
----
  azure-cli-configure-2.0.20.tar.gz

New:
----
  azure-cli-configure-2.0.24.tar.gz

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

Other differences:
------------------
++++++ azure-cli-configure.spec ++++++
--- /var/tmp/diff_new_pack.8ksu5l/_old  2019-10-31 18:15:35.622031533 +0100
+++ /var/tmp/diff_new_pack.8ksu5l/_new  2019-10-31 18:15:35.626031537 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           azure-cli-configure
-Version:        2.0.20
+Version:        2.0.24
 Release:        0
 Summary:        Microsoft Azure CLI 'configure' Command Module
 License:        MIT

++++++ azure-cli-configure-2.0.20.tar.gz -> azure-cli-configure-2.0.24.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-configure-2.0.20/HISTORY.rst 
new/azure-cli-configure-2.0.24/HISTORY.rst
--- old/azure-cli-configure-2.0.20/HISTORY.rst  2019-01-11 05:42:07.000000000 
+0100
+++ new/azure-cli-configure-2.0.24/HISTORY.rst  2019-06-13 23:17:46.000000000 
+0200
@@ -2,6 +2,23 @@
 
 Release History
 ===============
+
+2.0.24
+++++++
+* Minor fixes
+
+2.0.23
+++++++
+* Support folder based argument default value configurations
+
+2.0.22
+++++++
+* Minor fixes
+
+2.0.21
+++++++
+* Minor fixes
+
 2.0.20
 ++++++
 * Add 'none' as a configurable output format.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-configure-2.0.20/PKG-INFO 
new/azure-cli-configure-2.0.24/PKG-INFO
--- old/azure-cli-configure-2.0.20/PKG-INFO     2019-01-11 05:42:49.000000000 
+0100
+++ new/azure-cli-configure-2.0.24/PKG-INFO     2019-06-13 23:18:02.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: azure-cli-configure
-Version: 2.0.20
+Version: 2.0.24
 Summary: Microsoft Azure Command-Line Tools Configure Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
@@ -17,6 +17,23 @@
         
         Release History
         ===============
+        
+        2.0.24
+        ++++++
+        * Minor fixes
+        
+        2.0.23
+        ++++++
+        * Support folder based argument default value configurations
+        
+        2.0.22
+        ++++++
+        * Minor fixes
+        
+        2.0.21
+        ++++++
+        * Minor fixes
+        
         2.0.20
         ++++++
         * Add 'none' as a configurable output format.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/__init__.py 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/__init__.py
--- 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/__init__.py  
    2019-01-11 05:42:07.000000000 +0100
+++ 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/__init__.py  
    2019-06-13 23:17:46.000000000 +0200
@@ -4,7 +4,6 @@
 # 
--------------------------------------------------------------------------------------------
 
 from azure.cli.core import AzCommandsLoader
-from azure.cli.core.commands import CliCommandType
 
 import azure.cli.command_modules.configure._help  # pylint: 
disable=unused-import
 
@@ -15,19 +14,13 @@
         super(ConfigureCommandsLoader, self).__init__(cli_ctx=cli_ctx)
 
     def load_command_table(self, args):
-
-        configure_custom = 
CliCommandType(operations_tmpl='azure.cli.command_modules.configure.custom#{}')
-
-        with self.command_group('', configure_custom) as g:
-            g.command('configure', 'handle_configure')
-
+        from azure.cli.command_modules.configure.commands import 
load_command_table
+        load_command_table(self, args)
         return self.command_table
 
     def load_arguments(self, command):
-
-        with self.argument_context('configure') as c:
-            c.argument('defaults', nargs='+', options_list=('--defaults', 
'-d'))
-            c.ignore('_subscription')  # ignore the global subscription param
+        from azure.cli.command_modules.configure._params import load_arguments
+        load_arguments(self, command)
 
 
 COMMAND_LOADER_CLS = ConfigureCommandsLoader
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/_consts.py 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/_consts.py
--- 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/_consts.py   
    2019-01-11 05:42:07.000000000 +0100
+++ 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/_consts.py   
    2019-06-13 23:17:46.000000000 +0200
@@ -41,3 +41,6 @@
                        'about how you use Azure CLI.  To update your choice, 
run "az configure" ' \
                        'again.\nSelect y to enable data collection.'
 MSG_PROMPT_FILE_LOGGING = '\nWould you like to enable logging to file?'
+
+DEFAULT_CACHE_TTL = '10'
+MSG_PROMPT_CACHE_TTL = '\nCLI object cache time-to-live (TTL) in minutes 
[Default: {}]: '.format(DEFAULT_CACHE_TTL)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/_help.py 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/_help.py
--- old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/_help.py 
2019-01-11 05:42:07.000000000 +0100
+++ new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/_help.py 
2019-06-13 23:17:46.000000000 +0200
@@ -20,3 +20,28 @@
         - name: Clear default webapp and VM names.
           text: az configure --defaults vm='' web=''
 """
+
+helps['cache'] = """
+    type: group
+    short-summary: Commands to manage CLI objects cached using the `--defer` 
argument.
+"""
+
+helps['cache list'] = """
+    type: command
+    short-summary: List the contents of the object cache.
+"""
+
+helps['cache show'] = """
+    type: command
+    short-summary: Show the contents of a specific object in the cache.
+"""
+
+helps['cache delete'] = """
+    type: command
+    short-summary: Delete an object from the cache.
+"""
+
+helps['cache purge'] = """
+    type: command
+    short-summary: Clear the entire CLI object cache.
+"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/_params.py 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/_params.py
--- 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/_params.py   
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/_params.py   
    2019-06-13 23:17:46.000000000 +0200
@@ -0,0 +1,21 @@
+# 
--------------------------------------------------------------------------------------------
+# 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.parameters import get_enum_type, 
get_three_state_flag
+
+
+def load_arguments(self, _):
+
+    with self.argument_context('configure') as c:
+        c.argument('defaults', nargs='+', options_list=('--defaults', '-d'))
+        c.argument('list_defaults', options_list=('--list-defaults', '-l'),
+                   arg_type=get_three_state_flag(), help='list all applicable 
defaults')
+        c.argument('scope', arg_type=get_enum_type(['global', 'local']), 
default='global',
+                   help='scope of defaults. Using "local" for settings only 
effective under current folder')
+        c.ignore('_subscription')  # ignore the global subscription param
+
+    with self.argument_context('cache') as c:
+        c.argument('resource_type', options_list=['--resource-type', '-t'], 
help='The resource type.')
+        c.argument('item_name', options_list=['--name', '-n'], help='The 
resource name.')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/commands.py 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/commands.py
--- 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/commands.py  
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/commands.py  
    2019-06-13 23:17:46.000000000 +0200
@@ -0,0 +1,20 @@
+# 
--------------------------------------------------------------------------------------------
+# 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 CliCommandType
+
+
+def load_command_table(self, _):
+
+    configure_custom = 
CliCommandType(operations_tmpl='azure.cli.command_modules.configure.custom#{}')
+
+    with self.command_group('', configure_custom) as g:
+        g.command('configure', 'handle_configure')
+
+    with self.command_group('cache', configure_custom, is_preview=True) as g:
+        g.command('list', 'list_cache_contents')
+        g.command('show', 'show_cache_contents')
+        g.command('delete', 'delete_cache_contents')
+        g.command('purge', 'purge_cache_contents')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/custom.py 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/custom.py
--- 
old/azure-cli-configure-2.0.20/azure/cli/command_modules/configure/custom.py    
    2019-01-11 05:42:07.000000000 +0100
+++ 
new/azure-cli-configure-2.0.24/azure/cli/command_modules/configure/custom.py    
    2019-06-13 23:17:46.000000000 +0200
@@ -4,13 +4,16 @@
 # 
--------------------------------------------------------------------------------------------
 
 from __future__ import print_function
+import json
 import os
-from six.moves import configparser
 
+from knack.config import get_config_parser
 from knack.log import get_logger
 from knack.prompting import prompt, prompt_y_n, prompt_choice_list, 
prompt_pass, NoTTYException
 from knack.util import CLIError
 
+from azure.cli.core.util import ConfiguredDefaultSetter
+
 from azure.cli.command_modules.configure._consts import (OUTPUT_LIST, 
LOGIN_METHOD_LIST,
                                                          MSG_INTRO,
                                                          MSG_CLOSING,
@@ -21,7 +24,9 @@
                                                          
MSG_PROMPT_GLOBAL_OUTPUT,
                                                          MSG_PROMPT_LOGIN,
                                                          MSG_PROMPT_TELEMETRY,
-                                                         
MSG_PROMPT_FILE_LOGGING)
+                                                         
MSG_PROMPT_FILE_LOGGING,
+                                                         MSG_PROMPT_CACHE_TTL,
+                                                         DEFAULT_CACHE_TTL)
 from azure.cli.command_modules.configure._utils import get_default_from_config
 
 answers = {}
@@ -94,7 +99,7 @@
     # print location of global configuration
     print(MSG_GLOBAL_SETTINGS_LOCATION.format(config.config_path))
     # set up the config parsers
-    file_config = config.config_parser
+    file_config = get_config_parser()
     config_exists = file_config.read([config.config_path])
     should_modify_global_config = False
     if config_exists:
@@ -104,38 +109,49 @@
         answers['modify_global_prompt'] = should_modify_global_config
     if not config_exists or should_modify_global_config:
         # no config exists yet so configure global config or user wants to 
modify global config
-        output_index = prompt_choice_list(MSG_PROMPT_GLOBAL_OUTPUT, 
OUTPUT_LIST,
-                                          
default=get_default_from_config(config.config_parser,
-                                                                          
'core', 'output',
-                                                                          
OUTPUT_LIST))
-        answers['output_type_prompt'] = output_index
-        answers['output_type_options'] = str(OUTPUT_LIST)
-        enable_file_logging = prompt_y_n(MSG_PROMPT_FILE_LOGGING, default='n')
-        allow_telemetry = prompt_y_n(MSG_PROMPT_TELEMETRY, default='y')
-        answers['telemetry_prompt'] = allow_telemetry
-        # save the global config
-        try:
-            config.config_parser.add_section('core')
-        except configparser.DuplicateSectionError:
-            pass
-        try:
-            config.config_parser.add_section('logging')
-        except configparser.DuplicateSectionError:
-            pass
-        config.set_value('core', 'output', OUTPUT_LIST[output_index]['name'])
-        config.set_value('core', 'collect_telemetry', 'yes' if allow_telemetry 
else 'no')
-        config.set_value('logging', 'enable_log_file', 'yes' if 
enable_file_logging else 'no')
+        with ConfiguredDefaultSetter(config, False):
+            output_index = prompt_choice_list(MSG_PROMPT_GLOBAL_OUTPUT, 
OUTPUT_LIST,
+                                              
default=get_default_from_config(config,
+                                                                              
'core', 'output',
+                                                                              
OUTPUT_LIST))
+            answers['output_type_prompt'] = output_index
+            answers['output_type_options'] = str(OUTPUT_LIST)
+            enable_file_logging = prompt_y_n(MSG_PROMPT_FILE_LOGGING, 
default='n')
+            allow_telemetry = prompt_y_n(MSG_PROMPT_TELEMETRY, default='y')
+            answers['telemetry_prompt'] = allow_telemetry
+            cache_ttl = None
+            while not cache_ttl:
+                try:
+                    cache_ttl = prompt(MSG_PROMPT_CACHE_TTL) or 
DEFAULT_CACHE_TTL
+                    # ensure valid int by casting
+                    cache_value = int(cache_ttl)
+                    if cache_value < 1:
+                        raise ValueError
+                except ValueError:
+                    logger.error('TTL must be a positive integer')
+                    cache_ttl = None
+            # save the global config
+            config.set_value('core', 'output', 
OUTPUT_LIST[output_index]['name'])
+            config.set_value('core', 'collect_telemetry', 'yes' if 
allow_telemetry else 'no')
+            config.set_value('core', 'cache_ttl', cache_ttl)
+            config.set_value('logging', 'enable_log_file', 'yes' if 
enable_file_logging else 'no')
 
 
-def handle_configure(cmd, defaults=None):
+# pylint: disable=inconsistent-return-statements
+def handle_configure(cmd, defaults=None, list_defaults=None, scope=None):
     if defaults:
-        from azure.cli.core._config import DEFAULTS_SECTION
-        for default in defaults:
-            parts = default.split('=', 1)
-            if len(parts) == 1:
-                raise CLIError('usage error: --defaults STRING=STRING 
STRING=STRING ...')
-            cmd.cli_ctx.config.set_value(DEFAULTS_SECTION, parts[0], 
_normalize_config_value(parts[1]))
+        defaults_section = cmd.cli_ctx.config.defaults_section_name
+        with ConfiguredDefaultSetter(cmd.cli_ctx.config, scope.lower() == 
'local'):
+            for default in defaults:
+                parts = default.split('=', 1)
+                if len(parts) == 1:
+                    raise CLIError('usage error: --defaults STRING=STRING 
STRING=STRING ...')
+                cmd.cli_ctx.config.set_value(defaults_section, parts[0], 
_normalize_config_value(parts[1]))
         return
+    if list_defaults:
+        with ConfiguredDefaultSetter(cmd.cli_ctx.config, scope.lower() == 
'local'):
+            defaults_result = 
cmd.cli_ctx.config.items(cmd.cli_ctx.config.defaults_section_name)
+        return [x for x in defaults_result if x.get('value')]
 
     # if nothing supplied, we go interactively
     try:
@@ -153,3 +169,72 @@
     if value:
         value = '' if value in ["''", '""'] else value
     return value
+
+
+def _get_cache_directory(cli_ctx):
+    from azure.cli.core.commands.client_factory import get_subscription_id
+    from azure.cli.core._environment import get_config_dir
+    return os.path.join(
+        get_config_dir(),
+        'object_cache',
+        cli_ctx.cloud.name,
+        get_subscription_id(cli_ctx))
+
+
+def list_cache_contents(cmd):
+    from glob import glob
+    directory = _get_cache_directory(cmd.cli_ctx)
+    contents = []
+    rg_paths = glob(os.path.join(directory, '*'))
+    for rg_path in rg_paths:
+        rg_name = os.path.split(rg_path)[1]
+        for dir_name, _, file_list in os.walk(rg_path):
+            if not file_list:
+                continue
+            resource_type = os.path.split(dir_name)[1]
+            for f in file_list:
+                file_path = os.path.join(dir_name, f)
+                try:
+                    with open(file_path, 'r') as cache_file:
+                        cache_obj = json.loads(cache_file.read())
+                        contents.append({
+                            'resourceGroup': rg_name,
+                            'resourceType': resource_type,
+                            'name': f.split('.', 1)[0],
+                            'lastSaved': cache_obj['last_saved']
+                        })
+                except KeyError:
+                    # invalid cache entry
+                    logger.debug('Removing corrupt cache file: %s', file_path)
+                    os.remove(file_path)
+    return contents
+
+
+def show_cache_contents(cmd, resource_group_name, item_name, resource_type):
+    directory = _get_cache_directory(cmd.cli_ctx)
+    item_path = os.path.join(directory, resource_group_name, resource_type, 
'{}.json'.format(item_name))
+    try:
+        with open(item_path, 'r') as cache_file:
+            cache_obj = json.loads(cache_file.read())
+    except (OSError, IOError):
+        raise CLIError('Not found in cache: {}'.format(item_path))
+    return cache_obj['_payload']
+
+
+def delete_cache_contents(cmd, resource_group_name, item_name, resource_type):
+    directory = _get_cache_directory(cmd.cli_ctx)
+    item_path = os.path.join(directory, resource_group_name, resource_type, 
'{}.json'.format(item_name))
+    try:
+        os.remove(item_path)
+    except (OSError, IOError):
+        logger.info('%s not found in object cache.', item_path)
+
+
+def purge_cache_contents():
+    import shutil
+    from azure.cli.core._environment import get_config_dir
+    directory = os.path.join(get_config_dir(), 'object_cache')
+    try:
+        shutil.rmtree(directory)
+    except (OSError, IOError) as ex:
+        logger.debug(ex)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure_cli_configure.egg-info/PKG-INFO 
new/azure-cli-configure-2.0.24/azure_cli_configure.egg-info/PKG-INFO
--- old/azure-cli-configure-2.0.20/azure_cli_configure.egg-info/PKG-INFO        
2019-01-11 05:42:49.000000000 +0100
+++ new/azure-cli-configure-2.0.24/azure_cli_configure.egg-info/PKG-INFO        
2019-06-13 23:18:02.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: azure-cli-configure
-Version: 2.0.20
+Version: 2.0.24
 Summary: Microsoft Azure Command-Line Tools Configure Command Module
 Home-page: https://github.com/Azure/azure-cli
 Author: Microsoft Corporation
@@ -17,6 +17,23 @@
         
         Release History
         ===============
+        
+        2.0.24
+        ++++++
+        * Minor fixes
+        
+        2.0.23
+        ++++++
+        * Support folder based argument default value configurations
+        
+        2.0.22
+        ++++++
+        * Minor fixes
+        
+        2.0.21
+        ++++++
+        * Minor fixes
+        
         2.0.20
         ++++++
         * Add 'none' as a configurable output format.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/azure-cli-configure-2.0.20/azure_cli_configure.egg-info/SOURCES.txt 
new/azure-cli-configure-2.0.24/azure_cli_configure.egg-info/SOURCES.txt
--- old/azure-cli-configure-2.0.20/azure_cli_configure.egg-info/SOURCES.txt     
2019-01-11 05:42:49.000000000 +0100
+++ new/azure-cli-configure-2.0.24/azure_cli_configure.egg-info/SOURCES.txt     
2019-06-13 23:18:02.000000000 +0200
@@ -9,7 +9,9 @@
 azure/cli/command_modules/configure/__init__.py
 azure/cli/command_modules/configure/_consts.py
 azure/cli/command_modules/configure/_help.py
+azure/cli/command_modules/configure/_params.py
 azure/cli/command_modules/configure/_utils.py
+azure/cli/command_modules/configure/commands.py
 azure/cli/command_modules/configure/custom.py
 azure_cli_configure.egg-info/PKG-INFO
 azure_cli_configure.egg-info/SOURCES.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/azure-cli-configure-2.0.20/setup.py 
new/azure-cli-configure-2.0.24/setup.py
--- old/azure-cli-configure-2.0.20/setup.py     2019-01-11 05:42:07.000000000 
+0100
+++ new/azure-cli-configure-2.0.24/setup.py     2019-06-13 23:17:46.000000000 
+0200
@@ -15,7 +15,7 @@
     cmdclass = {}
 
 
-VERSION = "2.0.20"
+VERSION = "2.0.24"
 CLASSIFIERS = [
     'Development Status :: 5 - Production/Stable',
     'Intended Audience :: Developers',


Reply via email to