Skip to content

Commit 85ae7cd

Browse files
authored
Merge branch 'puppetlabs:main' into main
2 parents fa9786d + c0efabb commit 85ae7cd

25 files changed

+8529
-54
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ end
7575
group(:documentation, optional: true) do
7676
gem 'gettext-setup', '~> 1.0', require: false, platforms: [:ruby]
7777
gem 'ronn', '~> 0.7.3', require: false, platforms: [:ruby]
78+
gem 'puppet-strings', require: false, platforms: [:ruby]
7879
end
7980

8081
if File.exist? "#{__FILE__}.local"

ext/project_data.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,15 @@ gem_rdoc_options:
66
- --main
77
- README.md
88
- --line-numbers
9+
# Array of files to include when building source tarballs
10+
files:
11+
- '[A-Z]*'
12+
- install.rb
13+
- bin
14+
- lib
15+
- conf
16+
- man
17+
- examples
18+
- ext
19+
- tasks
20+
- locales

lib/puppet/application/filebucket.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ def help
7676
use your local file bucket by specifying '--local', or by specifying
7777
'--bucket' with a local path.
7878
79-
**Note**: Enabling and using the backup option, and by extension the
80-
filebucket resource, requires appropriate planning and management to ensure
81-
that sufficient disk space is available for the file backups. Generally, you
82-
can implement this using one of the following two options:
79+
**Important**: When you enable and use the backup option, and by extension
80+
the filebucket resource, you must ensure that sufficient disk space is
81+
available for the file backups. Generally, you can provide the disk space
82+
by using one of the following two options:
8383
8484
- Use a `find` command and `crontab` entry to retain only the last X days
8585
of file backups. For example:

lib/puppet/face/catalog.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
summary _("Retrieve the catalog for the node from which the command is run.")
3030
arguments "<certname>, <facts>"
3131
option("--facts_for_catalog") do
32-
summary _("Not yet implemented for the CLI; facts will be collected internally.")
32+
summary _("Not implemented for the CLI; facts are collected internally.")
3333
end
3434
returns <<-'EOT'
3535
A serialized catalog. When used from the Ruby API, returns a

lib/puppet/face/help.rb

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,33 @@ def legacy_applications
151151
end.sort
152152
end
153153

154+
def generate_summary(appname)
155+
if is_face_app?(appname)
156+
begin
157+
face = Puppet::Face[appname, :current]
158+
# Add deprecation message to summary if the face is deprecated
159+
summary = face.deprecated? ? face.summary + ' ' + _("(Deprecated)") : face.summary
160+
[appname, summary, ' ']
161+
rescue StandardError, LoadError
162+
error_message = _("!%{sub_command}! Subcommand unavailable due to error.") % { sub_command: appname }
163+
error_message += ' ' + _("Check error logs.")
164+
[error_message, '', ' ']
165+
end
166+
else
167+
begin
168+
summary = Puppet::Application[appname].summary
169+
if summary.empty?
170+
summary = horribly_extract_summary_from(appname)
171+
end
172+
[appname, summary, ' ']
173+
rescue StandardError, LoadError
174+
error_message = _("!%{sub_command}! Subcommand unavailable due to error.") % { sub_command: appname }
175+
error_message += ' ' + _("Check error logs.")
176+
[error_message, '', ' ']
177+
end
178+
end
179+
end
180+
154181
# Return a list of all applications (both legacy and Face applications), along with a summary
155182
# of their functionality.
156183
# @return [Array] An Array of Arrays. The outer array contains one entry per application; each
@@ -162,45 +189,38 @@ def all_application_summaries
162189

163190
if appname == COMMON || appname == SPECIALIZED || appname == BLANK
164191
result << appname
165-
elsif is_face_app?(appname)
166-
begin
167-
face = Puppet::Face[appname, :current]
168-
# Add deprecation message to summary if the face is deprecated
169-
summary = face.deprecated? ? face.summary + ' ' + _("(Deprecated)") : face.summary
170-
result << [appname, summary, ' ']
171-
rescue StandardError, LoadError
172-
error_message = _("!%{sub_command}! Subcommand unavailable due to error.") % { sub_command: appname }
173-
error_message += ' ' + _("Check error logs.")
174-
result << [error_message, '', ' ']
175-
end
176192
else
177-
begin
178-
summary = Puppet::Application[appname].summary
179-
if summary.empty?
180-
summary = horribly_extract_summary_from(appname)
181-
end
182-
result << [appname, summary, ' ']
183-
rescue StandardError, LoadError
184-
error_message = _("!%{sub_command}! Subcommand unavailable due to error.") % { sub_command: appname }
185-
error_message += ' ' + _("Check error logs.")
186-
result << [error_message, '', ' ']
187-
end
193+
result << generate_summary(appname)
188194
end
189195
end
190196
end
191197

192198
COMMON = 'Common:'
193199
SPECIALIZED = 'Specialized:'
194200
BLANK = "\n"
201+
COMMON_APPS = %w[apply agent config help lookup module resource]
195202
def available_application_names_special_sort
196203
full_list = Puppet::Application.available_application_names
197-
a_list = full_list & %w[apply agent config help lookup module resource]
204+
a_list = full_list & COMMON_APPS
198205
a_list = a_list.sort
199206
also_ran = full_list - a_list
200207
also_ran = also_ran.sort
201208
[[COMMON], a_list, [BLANK], [SPECIALIZED], also_ran].flatten(1)
202209
end
203210

211+
def common_app_summaries
212+
COMMON_APPS.map do |appname|
213+
generate_summary(appname)
214+
end
215+
end
216+
217+
def specialized_app_summaries
218+
specialized_apps = Puppet::Application.available_application_names - COMMON_APPS
219+
specialized_apps.filter_map do |appname|
220+
generate_summary(appname) unless exclude_from_docs?(appname)
221+
end
222+
end
223+
204224
def horribly_extract_summary_from(appname)
205225
help = Puppet::Application[appname].help.split("\n")
206226
# Now we find the line with our summary, extract it, and return it. This

lib/puppet/reference/configuration.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
val = "the Host's fully qualified domain name, as determined by Facter"
4444
when 'srv_domain'
4545
val = 'example.com'
46+
when 'http_user_agent'
47+
val = 'Puppet/<version> Ruby/<version> (<architecture>)'
4648
end
4749

4850
# Leave out the section information; it was apparently confusing people.

lib/puppet/settings.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ def self.default_certname
8181
end
8282

8383
def self.hostname_fact
84-
Puppet.runtime[:facter].value 'networking.hostname'
84+
ENV['PUPPET_REFERENCES_HOSTNAME'] || Puppet.runtime[:facter].value('networking.hostname')
8585
end
8686

8787
def self.domain_fact
88-
Puppet.runtime[:facter].value 'networking.domain'
88+
ENV['PUPPET_REFERENCES_DOMAIN'] || Puppet.runtime[:facter].value('networking.domain')
8989
end
9090

9191
def self.default_config_file_name

locales/puppet.pot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#, fuzzy
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: Puppet automation framework 8.8.0-40-gb8ac6f49a3\n"
9+
"Project-Id-Version: Puppet automation framework 8.8.0-49-gd70f906d86\n"
1010
"\n"
1111
"Report-Msgid-Bugs-To: https://tickets.puppetlabs.com\n"
12-
"POT-Creation-Date: 2024-08-14 00:21+0000\n"
13-
"PO-Revision-Date: 2024-08-14 00:21+0000\n"
12+
"POT-Creation-Date: 2024-08-29 16:36+0000\n"
13+
"PO-Revision-Date: 2024-08-29 16:36+0000\n"
1414
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1515
"Language-Team: LANGUAGE <[email protected]>\n"
1616
"Language: \n"
@@ -797,7 +797,7 @@ msgid "Retrieve the catalog for the node from which the command is run."
797797
msgstr ""
798798

799799
#: ../lib/puppet/face/catalog.rb:32
800-
msgid "Not yet implemented for the CLI; facts will be collected internally."
800+
msgid "Not implemented for the CLI; facts are collected internally."
801801
msgstr ""
802802

803803
#: ../lib/puppet/face/catalog.rb:103

man/man5/puppet.conf.5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ The time to wait for data to be read from an HTTP connection\. If nothing is rea
973973
The HTTP User\-Agent string to send when making network requests\.
974974
.
975975
.IP "\(bu" 4
976-
\fIDefault\fR: \fBPuppet/8\.9\.0 Ruby/3\.1\.1\-p18 (x86_64\-linux)\fR
976+
\fIDefault\fR: \fBPuppet/<version> Ruby/<version> (<architecture>)\fR
977977
.
978978
.IP "" 0
979979
.

man/man8/puppet-catalog.8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ puppet catalog find [\-\-terminus _TERMINUS] [\-\-facts_for_catalog] \fIcertname
122122
Retrieve the catalog for the node from which the command is run\.
123123
.
124124
.IP
125-
\fBOPTIONS\fR \fI\-\-facts_for_catalog\fR \- Not yet implemented for the CLI; facts will be collected internally\.
125+
\fBOPTIONS\fR \fI\-\-facts_for_catalog\fR \- Not implemented for the CLI; facts are collected internally\.
126126
.
127127
.IP
128128
\fBRETURNS\fR

0 commit comments

Comments
 (0)