Skip to content

Commit

Permalink
Implement "restart" for RemoteDB services
Browse files Browse the repository at this point in the history
It's not really a restart, as we can't control it, but it checks the DB
and returns the status properly.

Fixes: 7cdffe7
  • Loading branch information
evgeni committed Sep 4, 2024
1 parent 55bf8b0 commit e4b1454
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/foreman_maintain/utils/service/abstract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def stop
raise NotImplementedError
end

def restart
raise NotImplementedError
end

def enable
raise NotImplementedError
end
Expand Down
8 changes: 8 additions & 0 deletions lib/foreman_maintain/utils/service/remote_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ def stop
[0, db_status.last]
end

def restart
command_name = ForemanMaintain.command_name
db_status(<<~MSG
Remote databases are not managed by #{command_name} and therefore was not restarted.
MSG
)
end

def running?
status.first == 0
end
Expand Down

0 comments on commit e4b1454

Please sign in to comment.