Skip to content

Commit 894a8d4

Browse files
authored
Merge pull request #8357 from GabrielNagy/PUP-10671/add-server-runmode
(PUP-10671) Add `server` run mode and alias
2 parents 50e8442 + df5a26e commit 894a8d4

File tree

23 files changed

+77
-68
lines changed

23 files changed

+77
-68
lines changed

acceptance/tests/language/exported_resources.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def find(request)
103103
class Puppet::Resource::#{terminus_class_name} < Puppet::Indirector::Yaml
104104
desc "Read resource instances from cached catalogs"
105105
def search(request)
106-
catalog_dir = File.join(Puppet.run_mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir], "catalog", "*")
106+
catalog_dir = File.join(Puppet.run_mode.server? ? Puppet[:yamldir] : Puppet[:clientyamldir], "catalog", "*")
107107
results = Dir.glob(catalog_dir).collect { |file|
108108
catalog = Puppet::Resource::Catalog.convert_from(:pson, File.read(file))
109109
if catalog.name == request.options[:host]

lib/puppet/application/doc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'puppet/application'
22

33
class Puppet::Application::Doc < Puppet::Application
4-
run_mode :master
4+
run_mode :server
55

66
attr_accessor :unknown_args, :manifest
77

lib/puppet/application/lookup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Puppet::Application::Lookup < Puppet::Application
88
RUN_HELP = _("Run 'puppet lookup --help' for more details").freeze
99
DEEP_MERGE_OPTIONS = '--knock-out-prefix, --sort-merged-arrays, and --merge-hash-arrays'.freeze
1010

11-
run_mode :master
11+
run_mode :server
1212

1313
# Options for lookup
1414
option('--merge TYPE') do |arg|

lib/puppet/face/catalog.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
A serialized catalog.
9898
EOT
9999
when_invoked do |*args|
100-
Puppet.settings.preferred_run_mode = :master
100+
Puppet.settings.preferred_run_mode = :server
101101
Puppet::Face[:catalog, :current].find(*args)
102102
end
103103
end

lib/puppet/face/node.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
3333
$ puppet node find somenode.puppetlabs.lan --terminus plain --render-as yaml
3434
35-
Retrieve a node using the puppet master's configured ENC:
35+
Retrieve a node using the Puppet Server's configured ENC:
3636
37-
$ puppet node find somenode.puppetlabs.lan --terminus exec --run_mode master --render-as yaml
37+
$ puppet node find somenode.puppetlabs.lan --terminus exec --run_mode server --render-as yaml
3838
39-
Retrieve the same node from the puppet master:
39+
Retrieve the same node from the Puppet Server:
4040
4141
$ puppet node find somenode.puppetlabs.lan --terminus rest --render-as yaml
4242
EOT

lib/puppet/face/node/clean.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
# definition, and should not be modifiable beyond that. This is one of
2727
# the only places left in the code that tries to manipulate it. Other
2828
# parts of code that handle certificates behave differently if the
29-
# run_mode is master. Those other behaviors are needed for cleaning the
29+
# run_mode is server. Those other behaviors are needed for cleaning the
3030
# certificates correctly.
31-
Puppet.settings.preferred_run_mode = "master"
31+
Puppet.settings.preferred_run_mode = "server"
3232

3333
Puppet::Node::Facts.indirection.terminus_class = :yaml
3434
Puppet::Node::Facts.indirection.cache_class = :yaml

lib/puppet/indirector/catalog/compiler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def initialize
7575

7676
# Is our compiler part of a network, or are we just local?
7777
def networked?
78-
Puppet.run_mode.master?
78+
Puppet.run_mode.server?
7979
end
8080

8181
private

lib/puppet/indirector/facts/yaml.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def search(request)
2020

2121
# Return the path to a given node's file.
2222
def yaml_dir_path
23-
base = Puppet.run_mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir]
23+
base = Puppet.run_mode.server? ? Puppet[:yamldir] : Puppet[:clientyamldir]
2424
File.join(base, 'facts', '*.yaml')
2525
end
2626

lib/puppet/indirector/json.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def path(name, ext = '.json')
4141
raise ArgumentError, _("invalid key")
4242
end
4343

44-
base = Puppet.run_mode.master? ? Puppet[:server_datadir] : Puppet[:client_datadir]
44+
base = Puppet.run_mode.server? ? Puppet[:server_datadir] : Puppet[:client_datadir]
4545
File.join(base, self.class.indirection_name.to_s, name.to_s + ext)
4646
end
4747

lib/puppet/indirector/msgpack.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def path(name, ext = '.msgpack')
4848
raise ArgumentError, _("invalid key")
4949
end
5050

51-
base = Puppet.run_mode.master? ? Puppet[:server_datadir] : Puppet[:client_datadir]
51+
base = Puppet.run_mode.server? ? Puppet[:server_datadir] : Puppet[:client_datadir]
5252
File.join(base, self.class.indirection_name.to_s, name.to_s + ext)
5353
end
5454

0 commit comments

Comments
 (0)