Skip to content

Commit df61fbb

Browse files
authored
Fix rubocop errors (#104)
Style/RedundantCondition: Use double pipes || instead
1 parent 81a8211 commit df61fbb

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/fog/proxmox/helpers/disk_helper.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,35 +141,35 @@ def self.extract_size(disk_value)
141141
end
142142

143143
def self.disk?(id)
144-
DISKS_REGEXP.match(id) ? true : false
144+
DISKS_REGEXP.match(id) || false
145145
end
146146

147147
def self.cdrom?(value)
148-
CDROM_REGEXP.match(value) ? true : false
148+
CDROM_REGEXP.match(value) || false
149149
end
150150

151151
def self.server_disk?(id)
152-
SERVER_DISK_REGEXP.match(id) ? true : false
152+
SERVER_DISK_REGEXP.match(id) || false
153153
end
154154

155155
def self.rootfs?(id)
156-
ROOTFS_REGEXP.match(id) ? true : false
156+
ROOTFS_REGEXP.match(id) || false
157157
end
158158

159159
def self.mount_point?(id)
160-
MOUNT_POINT_REGEXP.match(id) ? true : false
160+
MOUNT_POINT_REGEXP.match(id) || false
161161
end
162162

163163
def self.container_disk?(id)
164164
rootfs?(id) || mount_point?(id)
165165
end
166166

167167
def self.template?(volid)
168-
TEMPLATE_REGEXP.match(volid) ? true : false
168+
TEMPLATE_REGEXP.match(volid) || false
169169
end
170170

171171
def self.cloud_init?(volid)
172-
CLOUD_INIT_REGEXP.match(volid) ? true : false
172+
CLOUD_INIT_REGEXP.match(volid) || false
173173
end
174174

175175
def self.of_type?(disk_h, vm_type)

lib/fog/proxmox/helpers/nic_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def self.collect_nics(attributes)
119119
end
120120

121121
def self.nic?(id)
122-
NICS_REGEXP.match(id) ? true : false
122+
NICS_REGEXP.match(id) || false
123123
end
124124

125125
def self.extract_ip(nic_value)

0 commit comments

Comments
 (0)