Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file.managed for windows #31969

Closed
twangboy opened this issue Mar 17, 2016 · 0 comments
Closed

Fix file.managed for windows #31969

twangboy opened this issue Mar 17, 2016 · 0 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 severity-critical top severity, seen by most users, serious issues severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Windows ZRELEASED - Boron
Milestone

Comments

@twangboy
Copy link
Contributor

Description of Issue/Question

PR: #31815 broke file.managed for windows. It created a new function called apply_template_on_contents. file.managed was modified to depend on the function. The function was created in file.py but not namespaced in win_file.py.

Setup

Windows 2008R2
Salt 2015.8.8 tag
State File:

  1 my_file:
  2   file.managed:
  3    - name: C:\stuff1.txt
  4    - template: jinja
  5    - contents:
  6      - hello and a few other things world
  7      - level = warning
  8      - SpongeBob = Cool
  9      - Patrick = Cool Too
 10      - Squidward = Cranky
 11      - Plankton = Evil Genious

Steps to Reproduce Issue

Apply the state and you receive the following error:

slee_build_win64:
----------
          ID: my_file
    Function: file.managed
        Name: C:\stuff1.txt
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "C:\salt\bin\lib\site-packages\salt\state.py", line 1626, in call
                  **cdata['kwargs'])
                File "C:\salt\bin\lib\site-packages\salt\loader.py", line 1492, in wrapper
                  return f(*args, **kwargs)
                File "C:\salt\bin\lib\site-packages\salt\states\file.py", line 1481, in managed
                  contents = __salt__['file.apply_template_on_contents'](
                File "C:\salt\bin\lib\site-packages\salt\loader.py", line 900, in __getitem__
                  func = super(LazyLoader, self).__getitem__(item)
                File "C:\salt\bin\lib\site-packages\salt\utils\lazy.py", line 93, in __getitem__
                  raise KeyError(key)
              KeyError: 'file.apply_template_on_contents'
     Started: 22:31:15.576000
    Duration: 827.0 ms
     Changes:

Versions Report

slee_build_win64:
    Salt Version:
               Salt: 2015.8.8

    Dependency Versions:
             Jinja2: 2.7.3
           M2Crypto: Not Installed
               Mako: Not Installed
             PyYAML: 3.11
              PyZMQ: 14.7.0
             Python: 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)]
               RAET: Not Installed
            Tornado: 4.2.1
                ZMQ: 4.1.2
               cffi: Not Installed
           cherrypy: Not Installed
           dateutil: 2.4.2
              gitdb: Not Installed
          gitpython: Not Installed
              ioflo: Not Installed
            libgit2: Not Installed
            libnacl: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.4.6
       mysql-python: 0.6.6.None
          pycparser: Not Installed
           pycrypto: 2.6.1
             pygit2: Not Installed
       python-gnupg: 0.3.7
              smmap: Not Installed
            timelib: Not Installed

    System Versions:
               dist:
            machine: AMD64
            release: 2008ServerR2
             system: 2008ServerR2 6.1.7601 SP1 Multiprocessor Free
@twangboy twangboy added Execution-Module Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Windows Confirmed Salt engineer has confirmed bug/feature - often including a MCVE severity-critical top severity, seen by most users, serious issues P1 Priority 1 ZRELEASED - Boron TEAM Platform labels Mar 17, 2016
@twangboy twangboy self-assigned this Mar 17, 2016
@twangboy twangboy added this to the B 0 milestone Mar 17, 2016
@meggiebot meggiebot added the fixed-pls-verify fix is linked, bug author to confirm fix label Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 severity-critical top severity, seen by most users, serious issues severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Windows ZRELEASED - Boron
Projects
None yet
Development

No branches or pull requests

2 participants