https://fedorahosted.org/freeipa/ticket/5251
--
Petr Vobornik
From 5144abbdca66a0e001876e7a05ea2773ab824008 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Tue, 25 Aug 2015 18:25:50 +0200
Subject: [PATCH] vault: change default vault type to symmetric

https://fedorahosted.org/freeipa/ticket/5251
---
 API.txt                 |  8 ++++----
 VERSION                 |  4 ++--
 ipalib/plugins/vault.py | 10 +++++++---
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/API.txt b/API.txt
index 1944a6f99a6732264c9aaa2d676e2897d36acae1..925f61241b3f5f2149c8869ddf0c92eca0cb962d 100644
--- a/API.txt
+++ b/API.txt
@@ -5411,7 +5411,7 @@ option: Str('addattr*', cli_name='addattr', exclude='webui')
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
 option: Str('description?', cli_name='desc')
 option: Bytes('ipavaultpublickey?', cli_name='public_key')
-option: Str('ipavaulttype?', cli_name='type')
+option: StrEnum('ipavaulttype?', autofill=True, cli_name='type', default=u'symmetric', values=(u'standard', u'symmetric', u'asymmetric'))
 option: Str('password?', cli_name='password')
 option: Str('password_file?', cli_name='password_file')
 option: Str('public_key_file?', cli_name='public_key_file')
@@ -5431,7 +5431,7 @@ option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui
 option: Str('description', attribute=True, cli_name='desc', multivalue=False, required=False)
 option: Bytes('ipavaultpublickey', attribute=True, cli_name='public_key', multivalue=False, required=False)
 option: Bytes('ipavaultsalt', attribute=True, cli_name='salt', multivalue=False, required=False)
-option: StrEnum('ipavaulttype', attribute=True, autofill=True, cli_name='type', default=u'standard', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
+option: StrEnum('ipavaulttype', attribute=True, autofill=True, cli_name='type', default=u'symmetric', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Str('service?')
@@ -5521,7 +5521,7 @@ arg: Str('criteria?', noextrawhitespace=False)
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
 option: Str('cn', attribute=True, autofill=False, cli_name='name', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.-]+$', primary_key=True, query=True, required=False)
 option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, query=True, required=False)
-option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'standard', multivalue=False, query=True, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
+option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'symmetric', multivalue=False, query=True, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('pkey_only?', autofill=True, default=False)
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
@@ -5546,7 +5546,7 @@ option: Str('delattr*', cli_name='delattr', exclude='webui')
 option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, required=False)
 option: Bytes('ipavaultpublickey', attribute=True, autofill=False, cli_name='public_key', multivalue=False, required=False)
 option: Bytes('ipavaultsalt', attribute=True, autofill=False, cli_name='salt', multivalue=False, required=False)
-option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'standard', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
+option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'symmetric', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric'))
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
 option: Flag('rights', autofill=True, default=False)
diff --git a/VERSION b/VERSION
index e8387a1ae7e2f11cfc7ab8626cd82df57d55d6b4..299256abcb936b28124fc28c0915bd4c14003dca 100644
--- a/VERSION
+++ b/VERSION
@@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
 #                                                      #
 ########################################################
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=152
-# Last change: mbasti - add 'user-stage' command
+IPA_API_VERSION_MINOR=153
+# Last change: pvoborni - change default vault type to 'symmetric'
diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py
index 4b2c8a518e5c9a93e5490841a3d2177536c905b1..6525becbf8ee915e172e18fd3ff936ac2efbca94 100644
--- a/ipalib/plugins/vault.py
+++ b/ipalib/plugins/vault.py
@@ -285,7 +285,7 @@ class vault(LDAPObject):
             label=_('Type'),
             doc=_('Vault type'),
             values=(u'standard', u'symmetric', u'asymmetric', ),
-            default=u'standard',
+            default=u'symmetric',
             autofill=True,
         ),
         Bytes(
@@ -552,10 +552,14 @@ class vault_add(PKQuery, Local):
             cli_name='desc',
             doc=_('Vault description'),
         ),
-        Str(
+        StrEnum(
             'ipavaulttype?',
             cli_name='type',
+            label=_('Type'),
             doc=_('Vault type'),
+            values=(u'standard', u'symmetric', u'asymmetric', ),
+            default=u'symmetric',
+            autofill=True,
         ),
         Str(
             'password?',
@@ -583,7 +587,7 @@ class vault_add(PKQuery, Local):
 
     def forward(self, *args, **options):
 
-        vault_type = options.get('ipavaulttype', u'standard')
+        vault_type = options.get('ipavaulttype')
         password = options.get('password')
         password_file = options.get('password_file')
         public_key = options.get('ipavaultpublickey')
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to