0
내 속성에 특성 파일에 값, 빈 문자열 또는 nil이 포함되어 있는지 어떻게 확인합니까?속성 파일에서 노드 속성이 비어 있거나 null 인 경우
내가 노드 속성이 값 또는 null이 있는지 확인하는 가장 좋은 방법이 무엇인지 다만 확실하지 오전 내 default.rb
이를 세웠 죠?
#<> Supply endpoint or not < clients will supply this value or not in my run list >
default[:my_code][:my_endpoint] = ""
#Option 1
if node[:my_code][:my_endpoint] == ""
default[:my_code][:my_endpoint] = 'default'
end
#Option 2
if node[:my_code][:my_endpoint].to_s.empty?
default[:my_code][:my_endpoint] = 'default'
end
내 환경이 저하되어 현재 테스트 할 수 없으므로 지금 당장이 질문을 머리에 쓰겠습니다. 나는 실제로 선택권 2를 시도하지 않았다. 나는 지금 막 이것이 왜 googling 또는 더 나은 대안이 있는지 알아 냈다
어떻게'default [: my_code] [: my_endpoint] || = 'default''입니까? – user000001