Skip to content

Commit

Permalink
Deprecate DEFAULT.mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaroqui committed Oct 4, 2017
1 parent 136ab26 commit 614b5d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
7 changes: 5 additions & 2 deletions lib/svcdict.py
Expand Up @@ -6,6 +6,7 @@

# deprecated => supported
deprecated_keywords = {
"DEFAULT.mode": None,
"DEFAULT.service_type": "env",
"DEFAULT.affinity": "hard_affinity",
"DEFAULT.anti_affinity": "hard_anti_affinity",
Expand Down Expand Up @@ -408,12 +409,14 @@ def getkey(self, keyword, rtype=None):
if '@' in keyword:
l = keyword.split('@')
if len(l) != 2:
return None
return
keyword, node = l
if rtype:
fkey = ".".join((self.section, rtype, keyword))
if fkey in deprecated_keywords:
keyword = deprecated_keywords[fkey]
if keyword is None:
return
for k in self.keywords:
if k.keyword != keyword:
continue
Expand All @@ -430,7 +433,7 @@ def getkey(self, keyword, rtype=None):
for k in self.keywords:
if k.keyword == keyword:
return k
return None
return

class KeywordStore(dict):
def __init__(self, provision=False):
Expand Down
16 changes: 0 additions & 16 deletions usr/share/doc/template.DEFAULT.conf
Expand Up @@ -5,22 +5,6 @@
##############################################################################

[DEFAULT]
#
# keyword: mode
# ----------------------------------------------------------------------------
# scopable: False
# required: False
# provisioning: False
# default: hosted
# inheritance: leaf > head
# scope order: specific > generic
# candidates: hosted
#
# desc: Deprecated. The value is always 'hosted'. The keyword is kept around
# for now the ease transition from older agents.
#
;mode = hosted

#
# keyword: lock_timeout
# ----------------------------------------------------------------------------
Expand Down

0 comments on commit 614b5d0

Please sign in to comment.