Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 01d30aa

Browse files
committed
added installer documentation
1 parent 74be9c3 commit 01d30aa

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ print(p.fix(output_file))
5656
The `output_file` parameter will write the output of the `fix` function to a file.
5757

5858

59-
### [Packer.inspect()](https://www.packer.io/docs/command-line/inspect.html)
59+
### [Packer.inspect()](https://www.packer.io/docs/command-line/inspect.html)
6060

6161
A `-machine-readable` (mrf) argument is provided.
6262

@@ -152,6 +152,19 @@ p = packer.Packer(packerfile, ...)
152152
print(p.version())
153153
```
154154

155+
### PackerInstaller.install()
156+
157+
This installs packer to `packer_path` using the `installer_path` and verifies that the installation was successful.
158+
159+
```python
160+
161+
packer_path = '/usr/bin/'
162+
installer_path = 'Downloads/packer_0.7.5_linux_amd64.zip'
163+
164+
p = packer.Installer(packer_path, installer_path)
165+
p.install()
166+
```
167+
155168
## Shell Interaction
156169

157170
The [sh](http://amoffat.github.io/sh/) Python module is used to execute Packer.

packer/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _parse_inspection_output(self, output):
204204
return parts
205205

206206

207-
class Install():
207+
class Installer():
208208
def __init__(self, packer_path, installer_path):
209209
self.packer_path = packer_path
210210
self.installer_path = installer_path
@@ -232,6 +232,3 @@ class ValidationObject():
232232

233233
class PackerException(Exception):
234234
pass
235-
236-
237-
# 0587508070

tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
vars = {}
1010
vars_file = '/x'
1111

12-
p = packer.Install('packer_executables/', 'packer_0.7.5_linux_amd64.zip')
12+
p = packer.Installer('packer_executables/', 'packer_0.7.5_linux_amd64.zip')
1313
# If we installed packer using the provided installer, it will return
1414
# packer's executable path. We can use it below:
1515
# packer_exec = p.install()

0 commit comments

Comments
 (0)