Skip to content

Commit 80ab052

Browse files
committed
Lints
Signed-off-by: Ian Maddaus <[email protected]>
1 parent 442d639 commit 80ab052

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

content/custom_resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Follow these steps to create a new custom resource:
3636

3737
1. Generate a new custom resource.
3838

39-
The `resources` directory does not exist by default in a cookbook.
39+
The `resources` directory doesn't exist by default in a cookbook.
4040
Generate the `resources` directory and a resource file from the `chef-repo/cookbooks` directory with the command:
4141

4242
```bash
@@ -140,7 +140,7 @@ where:
140140
- `site` is the name of the custom resource. The `provides` statement makes the custom resource available for use recipes.
141141
- `homepage` sets the default HTML for the `index.html` file with a default value of `'<h1>Hello world!</h1>'`
142142
- the `action` block uses the built-in collection of resources to tell Chef Infra Client how to install Apache, start the service, and then create the contents of the file located at `/var/www/html/index.html`
143-
- `action :create` is the default resource (because it is listed first); `action :delete` must be called specifically (because it is not the default action)
143+
- `action :create` is the default resource (because it's listed first); `action :delete` must be called specifically (because it's not the default action)
144144
145145
Once written, you can use a custom resource in a recipe with the same syntax as Chef Infra Client built-in resources.
146146

content/unified_mode.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ product = ["client"]
2222

2323
## Unified Mode isolation
2424

25-
If a Unified Mode resource calls a non-Unified Mode resource, the called resource is not executed in Unified Mode. Each resource maintains its own state whether it is in Unified Mode or not. You do not need to modify a custom resource that calls a Unified Mode resource since the calling context will not affect the resource's execution. Resources using Unified Mode may call resources not using Unified Mode and vice versa.
25+
If a Unified Mode resource calls a non-Unified Mode resource, the called resource isn't executed in Unified Mode.
26+
Each resource maintains its own state whether it's in Unified Mode or not.
27+
You don't need to modify a custom resource that calls a Unified Mode resource since the calling context won't affect the resource's execution.
28+
Resources using Unified Mode may call resources not using Unified Mode and vice versa.
2629

2730
## Benefits of Unified Mode
2831

@@ -34,11 +37,12 @@ With the deferred execution of resources to converge time, the user has to under
3437

3538
### Elimination of lazy blocks
3639

37-
Several aspects of the Chef Infra Language still work but are no longer necessary in Unified Mode. Unified Mode eliminates the need for lazy blocks and the need to lazy Ruby code through a Ruby block.
40+
Several aspects of the Chef Infra Language still work but are no longer necessary in Unified Mode.
41+
Unified Mode eliminates the need for lazy blocks and the need to lazy Ruby code through a Ruby block.
3842

3943
### Rescue blocks and other Ruby constructs work correctly
4044

41-
In Unified Mode, it is now easy to write a rescue wrapper around a Chef Infra resource:
45+
In Unified Mode, it's now easy to write a rescue wrapper around a Chef Infra resource:
4246

4347
```ruby
4448
begin
@@ -118,7 +122,7 @@ action :install do
118122

119123
# the downloading of this file acts as a guard for all the later
120124
# resources -- but if the download is successful while the later
121-
# resources fail for some transient issue, will will not redownload on
125+
# resources fail for some transient issue, will won't redownload on
122126
# the next run -- we lose our edge trigger.
123127
#
124128
remote_file "/tmp/redis-#{version}.tar.gz" do
@@ -150,7 +154,7 @@ end
150154

151155
This simplified example shows how to trap exceptions from resources using normal Ruby syntax and to clean up the resource. Without Unified Mode, this syntax is impossible. Normally when the [execute]({{< relref "resources/execute" >}}) resources are parsed, they only create the objects in the `resource_collection` to later be evaluated so that no exception is thrown while Ruby is parsing the `action` block. Every action is delayed to the later converge phase. In Unified Mode, the resource runs when Ruby is done parsing its block, so exceptions happen in-line with Ruby parsing and the rescue clause now works as expected.
152156

153-
This is useful because the TAR extraction throws an exception (for example, the node could be out of disk space), which deletes the TAR file. The next time Chef Infra Client runs, the TAR file will be redownload. If the resource did not have file cleanup after an exception, the TAR file would remain on the client node even though the resource is not complete and the extraction did not happen, leaving the resource in a broken, indeterminate state.
157+
This is useful because the TAR extraction throws an exception (for example, the node could be out of disk space), which deletes the TAR file. The next time Chef Infra Client runs, the TAR file will be redownload. If the resource did not have file cleanup after an exception, the TAR file would remain on the client node even though the resource isn't complete and the extraction did not happen, leaving the resource in a broken, indeterminate state.
154158

155159
{{< readfile file="content/reusable/md/unified_mode_actions_later_resources.md" >}}
156160

0 commit comments

Comments
 (0)