class ChefCLI::PolicyfileLock

def set_name_from_lock_data(lock_data)

def set_name_from_lock_data(lock_data)
  name_attribute = lock_data["name"]
  raise InvalidLockfile, "lockfile does not have a `name' attribute" if name_attribute.nil?
  unless name_attribute.is_a?(String)
    raise InvalidLockfile, "lockfile's name attribute must be a String (got: #{name_attribute.inspect})"
  end
  if name_attribute.empty?
    raise InvalidLockfile, "lockfile's name attribute cannot be an empty string"
  end
  @name = name_attribute
end