diff options
| author | zsdc <taras@vyos.io> | 2020-03-11 21:20:58 +0200 | 
|---|---|---|
| committer | zsdc <taras@vyos.io> | 2020-03-11 21:22:23 +0200 | 
| commit | c6627bc05a57645e6af8b9a5a67e452d9f37e487 (patch) | |
| tree | b754b3991e5e57a9ae9155819f73fa0cbd4be269 /cloudinit/config/cc_ntp.py | |
| parent | ca9a4eb26b41c204d1bd3a15586b14a5dde950bb (diff) | |
| parent | 13e82554728b1cb524438163784e5b955c7c5ed0 (diff) | |
| download | vyos-cloud-init-c6627bc05a57645e6af8b9a5a67e452d9f37e487.tar.gz vyos-cloud-init-c6627bc05a57645e6af8b9a5a67e452d9f37e487.zip | |
Cloud-init: T2117: Updated to 20.1
  - Merge 20.1 version from the Canonical repository
  - Removed unneeded changes in datasources (now only OVF datasource is not equal to upstream's version)
  - Adapted cc_vyos module to new Cloud-init version
  - Changed Jenkinsfile to use build scripts, provided by upstream
Diffstat (limited to 'cloudinit/config/cc_ntp.py')
| -rw-r--r-- | cloudinit/config/cc_ntp.py | 20 | 
1 files changed, 9 insertions, 11 deletions
| diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py index 9e074bda..5498bbaa 100644 --- a/cloudinit/config/cc_ntp.py +++ b/cloudinit/config/cc_ntp.py @@ -6,19 +6,17 @@  """NTP: enable and configure ntp""" -from cloudinit.config.schema import ( -    get_schema_doc, validate_cloudconfig_schema) +import copy +import os +from textwrap import dedent +  from cloudinit import log as logging -from cloudinit.settings import PER_INSTANCE  from cloudinit import temp_utils  from cloudinit import templater  from cloudinit import type_utils  from cloudinit import util - -import copy -import os -import six -from textwrap import dedent +from cloudinit.config.schema import get_schema_doc, validate_cloudconfig_schema +from cloudinit.settings import PER_INSTANCE  LOG = logging.getLogger(__name__) @@ -460,7 +458,7 @@ def supplemental_schema_validation(ntp_config):      for key, value in sorted(ntp_config.items()):          keypath = 'ntp:config:' + key          if key == 'confpath': -            if not all([value, isinstance(value, six.string_types)]): +            if not all([value, isinstance(value, str)]):                  errors.append(                      'Expected a config file path {keypath}.'                      ' Found ({value})'.format(keypath=keypath, value=value)) @@ -472,11 +470,11 @@ def supplemental_schema_validation(ntp_config):          elif key in ('template', 'template_name'):              if value is None:  # Either template or template_name can be none                  continue -            if not isinstance(value, six.string_types): +            if not isinstance(value, str):                  errors.append(                      'Expected a string type for {keypath}.'                      ' Found ({value})'.format(keypath=keypath, value=value)) -        elif not isinstance(value, six.string_types): +        elif not isinstance(value, str):              errors.append(                  'Expected a string type for {keypath}.'                  ' Found ({value})'.format(keypath=keypath, value=value)) | 
