saltstack / saltstack/salt

salt.modules.timezone: It is not enough to check for timedatectl existence

Open
#39,357 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Confirmed Execution-Module Platform severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description of Issue/Question

salt.modules.timezone only checks if timedatectl exists but this not enough: dbus-daemon must be installed and running as well. Otherwise you will get an error like

minion32.example.org:
----------
          ID: Europe/Berlin
    Function: timezone.system
      Result: False
     Comment: Unable to compare desired timezone 'Europe/Berlin' to system timezone: timedatectl failed: Failed to create bus connection: No such file or directory
     Started: 13:58:54.247773
    Duration: 7.331 ms
     Changes:
----------

Steps to Reproduce Issue
  1. Install Debian Jessie (8.7 as of today) in minbase variant using debootstrap (debootstrap --variant=minbase --arch amd64 jessie /mnt/debian http://httpredir.debian.org/debian).

  2. Create a timezone.sls state with the following content:

Europe/Berlin:
  timezone.system
  1. Execute the state on your fresh system set up in step 1.
Versions Report
# salt --versions-report
Salt Version:
           Salt: 2016.11.2

Dependency Versions:
           cffi: 0.8.6
       cherrypy: Not Installed
       dateutil: 2.2
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.2
   mysql-python: 1.2.3
      pycparser: 2.10
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: debian 8.7
        machine: x86_64
        release: 3.16.0-4-amd64
         system: Linux
        version: debian 8.7

(Salt from https://repo.saltstack.com/#debian)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt.modules.timezone and the timezone.system state described in the report. Reproduce the minbase Debian Jessie setup and inspect how timedatectl availability is checked before the state runs. Done means the missing dbus-daemon condition is handled without the reported timedatectl bus-connection failure, with coverage for the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.