miq_utilities 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/miq_utilities/notification.rb +2 -12
- data/lib/miq_utilities/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef7a79eec7483ea2fc869da3db5b99f9c3365ce60a2ecb77e045fe9acbc58da4
|
4
|
+
data.tar.gz: 8a5111bdd92cfbe2e860cc02b9e97050ad543a61f937df6d7d49aa1d1b8925fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8e0c19f9b15ebec563ce9806680378eb23a07535ff29255bee197384fc6db7f3258348715f6766db63406900ab35601a2876cdd66afe5d2dd842bb20811d719
|
7
|
+
data.tar.gz: d254178094b7820d801050d6ee2a24c87463db0ae598142608d743d55c7756de53efd08d16a88be98d8df980339634780c5a30b606542f8df32867f74ac799c2
|
data/Gemfile.lock
CHANGED
@@ -49,19 +49,9 @@ class NotificationClass
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def send_email(message:, subject:, from_email:, signature:, to_email: nil)
|
52
|
-
to = nil
|
53
52
|
if to_email.nil?
|
54
|
-
|
55
|
-
|
56
|
-
# Get VM Owner ID and then Email
|
57
|
-
evm_owner_id = vm.attributes['evm_owner_id']
|
58
|
-
owner = $evm.vmdb('user', evm_owner_id) unless evm_owner_id.nil?
|
59
|
-
# to_email_address from owner.email then from model if nil
|
60
|
-
to = if owner
|
61
|
-
owner.email.to_s.strip
|
62
|
-
else
|
63
|
-
$evm.object['to_email_address'].to_s.strip unless $evm.nil?
|
64
|
-
end
|
53
|
+
user = $evm.root['user']
|
54
|
+
to = user.attributes['email']
|
65
55
|
# Look at the Event Type in the Current Object or in the Root Object
|
66
56
|
event_type = $evm.object['event'] || $evm.root['event_type']
|
67
57
|
end
|