#13 Fix: add two additional patches for change_host_name logic
Merged 5 years ago by pvalena. Opened 5 years ago by pvalena.
rpms/ pvalena/vagrant rebase  into  master

@@ -550,3 +550,49 @@ 

           end

   

           let(:nm_yml) { "---\nnetwork:\n  version: 2\n  renderer: NetworkManager\n  ethernets:\n    eth1:\n      dhcp4: true\n    eth2:\n      addresses:\n      - 33.33.33.10/16\n      gateway4: 33.33.0.1\n" }

+ 

+ From 1797798760eb72d6b02724f75bc54dd83815e986 Mon Sep 17 00:00:00 2001

+ From: Chris Roberts <croberts@hashicorp.com>

+ Date: Fri, 28 Sep 2018 07:59:39 -0700

+ Subject: [PATCH] Fix module name

+ 

+ ---

+  plugins/guests/redhat/cap/change_host_name.rb | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb

+ index 5da660df05..37c8912a80 100644

+ --- a/plugins/guests/redhat/cap/change_host_name.rb

+ +++ b/plugins/guests/redhat/cap/change_host_name.rb

+ @@ -3,7 +3,7 @@ module GuestRedHat

+      module Cap

+        class ChangeHostName

+  

+ -        extend Vagrant::Util::GuestInspection

+ +        extend Vagrant::Util::GuestInspection::Linux

+  

+          def self.change_host_name(machine, name)

+            comm = machine.communicate

+ 

+ From 11b0d58fa081cd9a27c272244a0d119acc81f32e Mon Sep 17 00:00:00 2001

+ From: Chris Roberts <croberts@hashicorp.com>

+ Date: Mon, 1 Oct 2018 08:43:49 -0700

+ Subject: [PATCH] Include communicator on call

+ 

+ ---

+  plugins/guests/redhat/cap/change_host_name.rb | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb

+ index 37c8912a80..5ceb63665a 100644

+ --- a/plugins/guests/redhat/cap/change_host_name.rb

+ +++ b/plugins/guests/redhat/cap/change_host_name.rb

+ @@ -31,7 +31,7 @@ def self.change_host_name(machine, name)

+  

+              restart_command = "service network restart"

+  

+ -            if systemd?

+ +            if systemd?(comm)

+                if systemd_networkd?(comm)

+                  restart_command = "systemctl restart systemd-networkd.service"

+                elsif systemd_controlled?(comm, "NetworkManager.service")

file modified
+11 -3
@@ -4,7 +4,7 @@ 

  

  Name: vagrant

  Version: 2.1.5

- Release: 1%{?dist}

+ Release: 2%{?dist}

  Summary: Build and distribute virtualized development environments

  Group: Development/Languages

  License: MIT
@@ -29,6 +29,8 @@ 

  # Update restart logic in redhat change_host_name cap

  # https://bugzilla.redhat.com/show_bug.cgi?id=1624068

  # https://github.com/hashicorp/vagrant/pull/10223

+ # https://github.com/hashicorp/vagrant/commit/11b0d58fa081cd9a27c272244a0d119acc81f32e

+ # https://github.com/hashicorp/vagrant/commit/1797798760eb72d6b02724f75bc54dd83815e986

  Patch1: vagrant-2.1.6-update-restart-logic-in-redhat.patch

  

  Requires: ruby(release)
@@ -55,6 +57,7 @@ 

  

  BuildRequires: bsdtar

  BuildRequires: ruby

+ BuildRequires: rubygems-devel

  BuildRequires: rubygem(listen)

  BuildRequires: rubygem(childprocess)

  BuildRequires: rubygem(hashicorp-checkpoint)
@@ -106,6 +109,9 @@ 

  %patch1 -p1

  

  %build

+ %gemspec_remove_dep -s %{name}.gemspec -g childprocess '~> 0.5.0'

+ %gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 0.5.0'

+ 

  gem build %{name}.gemspec

  

  gem install -V --local \
@@ -184,8 +190,7 @@ 

  sed -i '/thor/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec

  sed -i '/rspec/ s/~>/>=/' ./vagrant.gemspec

  sed -i '/rspec/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec

- # TODO: package newer childproccess

- sed -i '/childprocess/ s/~>/<=/' ../vagrant-spec/vagrant-spec.gemspec

+ sed -i '/childprocess/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec

  

  #Insert new test dependencies

  sed -i '25 i\  spec.add_dependency "webmock"' ../vagrant-spec/vagrant-spec.gemspec
@@ -321,6 +326,9 @@ 

  

  

  %changelog

+ * Thu Oct 11 2018 Pavel Valena <pvalena@redhat.com> - 2.1.5-2

+ - Fix: two additional patches for change_host_name logic(rhbz#1624068)

+ 

  * Wed Sep 19 2018 Pavel Valena <pvalena@redhat.com> - 2.1.5-1

  - Update to Vagrant 2.1.5.

  - Update restart logic for redhat change_host_name cap(rhbz#1624068)

Copr build:
https://copr.fedorainfracloud.org/coprs/pvalena/vagrant/build/813843/

Up-to-date scratch-build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=30436209

Checks:

  • Smoke test: ok

Smoke test env:

  • vagrant-2.1.5-2.fc28.noarch
  • rubygem-childprocess-0.9.0-1.fc28.noarch
  • vagrant-libvirt-0.0.40-5.fc28.noarch
  • rubygems-2.7.7-104.fc28.noarch
  • ruby-2.5.3-101.fc28.x86_64

You should fix the missing changelog version in the first commit.

And you should improve your commit messages. A message like "Fix: add two additional patches for change_host_name logic" just describes what you did (which is obvious from the commit content), but says nothing about why you did that.

And please check the "simple-koji-ci" failure.

And you should improve your commit messages. A message like "Fix: add two additional patches for change_host_name logic" just describes what you did (which is obvious from the commit content), but says nothing about why you did that.

Yes, it was a bit rushed, thanks, I'll polish that.

I know the simple-koji-ci is failing. I'll prepare, submit, and test multiple packages at once when ready.

E.g. rubygem-childprocess needs to be upgraded(PR) for this to work.

rebased onto 76d7f3f

5 years ago

2 new commits added

  • Allow use of newer Childprocess gem
  • Fix: add two additional patches for change_host_name logic
5 years ago

I've allowed lower Childprocess version, as the chosen one seem to be arbitrary (no tests failing).

Smoke-tested with:

  • vagrant-2.1.5-5.fc28.noarch
  • vagrant-libvirt-0.0.43-2.fc28.noarch
  • rubygem-childprocess-0.5.9-4.fc28.noarch
  • ruby-2.5.3-101.fc28.x86_64
  • rubygems-2.7.7-104.fc28.noarch

Note: release numbers above are arbitrary, and used only in my COPR.

Pull-Request has been merged by pvalena

5 years ago