core: Nextcloud: UnboundLocalError: local variable 'ncm' referenced before assignment

The problem

I tried to setup nextcloud configuration based on manual.

What version of Home Assistant Core has the issue?

core-2022.10.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

nextcloud

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nextcloud/

Diagnostics information

Logger: homeassistant.setup
Source: components/nextcloud/__init__.py:105
First occurred: 15:48:28 (1 occurrences)
Last logged: 15:48:28

Error during setup of component nextcloud
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
    result = await task
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/nextcloud/__init__.py", line 105, in setup
    hass.data[DOMAIN] = get_data_points(ncm.data)
UnboundLocalError: local variable 'ncm' referenced before assignment

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @meichthys , as i don’t have working nextcloud server i cannot test this code. Could you test it and fix bugs if you find any? It is more or less your own code anyway 😉 I will try write some tests today and if it will work for you i can create PR.

Thank you very much for provided info and sorry for bothering.