github.com/phobos182/packer@v0.2.3-0.20130819023704-c84d2aeffc68/website/source/docs/command-line/fix.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Fix - Command-Line"
     4  ---
     5  
     6  # Command-Line: Fix
     7  
     8  The `packer fix` command takes a template and finds backwards incompatible
     9  parts of it and brings it up to date so it can be used with the latest version
    10  of Packer. After you update to a new Packer release, you should run the
    11  fix command to make sure your templates work with the new release.
    12  
    13  The fix command will output the changed template to standard out, so you
    14  should redirect standard using standard OS-specific techniques if you want to
    15  save it to a file. For example, on Linux systems, you may want to do this:
    16  
    17  ```
    18  $ packer fix old.json > new.json
    19  ```
    20  
    21  If fixing fails for any reason, the fix command will exit with a non-zero
    22  exit status. Error messages appear on standard error, so if you're redirecting
    23  output, you'll still see error messages.
    24  
    25  <div class="alert alert-block alert-info">
    26  <strong>Even when Packer fix doesn't do anything</strong> to the template,
    27  the template will be outputted to standard out. Things such as configuration
    28  key ordering and indentation may be changed. The output format however, is
    29  pretty-printed for human readability.
    30  </div>
    31  
    32  The full list of fixes that the fix command performs is visible in the
    33  help output, which can be seen via `packer fix -h`.