Repository: iterative/dvc

Issue:
Analytics throws config error on remote add
System: Ubuntu 18.04
Dvc version: 0.41.3+c587c5 (current master)

running following script:
```
#!/bin/bash

rm -rf repo storage
mkdir repo storage

cd repo

git init >> /dev/null && dvc init >> /dev/null 

dvc remote add -d storage ../storage

```
results in error:
```
Traceback (most recent call last):
  File "/home/prd/development/tools/venvs/dvc3.6/bin/dvc", line 11, in <module>
    load_entry_point('dvc', 'console_scripts', 'dvc')()
  File "/home/prd/development/projects/dvc/dvc/main.py", line 57, in main
    Analytics().send_cmd(cmd, args, ret)
  File "/home/prd/development/projects/dvc/dvc/analytics.py", line 256, in send_cmd
    if not Analytics._is_enabled(cmd):
  File "/home/prd/development/projects/dvc/dvc/analytics.py", line 240, in _is_enabled
    enabled = Analytics._is_enabled_config(config)
  File "/home/prd/development/projects/dvc/dvc/analytics.py", line 212, in _is_enabled_config
    core = config.config.get(Config.SECTION_CORE, {})
  File "/home/prd/development/projects/dvc/dvc/config.py", line 563, in get
    "option '{}.{}' doesn't exist".format(section, opt)
dvc.config.ConfigError: config file error: option 'core.{}' doesn't exist
```
running same script for 
`0.41.3` does not raise this exception




Discussion:

Resolving patch:
diff --git a/dvc/command/cache.py b/dvc/command/cache.py
--- a/dvc/command/cache.py
+++ b/dvc/command/cache.py
@@ -10,10 +10,10 @@
 class CmdCacheDir(CmdConfig):
     def __init__(self, args):
         super(CmdCacheDir, self).__init__(args)
-        self.config = CacheConfig(self.config)
+        self.cache_config = CacheConfig(self.config)
 
     def run(self):
-        self.config.set_dir(self.args.value, level=self.args.level)
+        self.cache_config.set_dir(self.args.value, level=self.args.level)
         return 0
 
 
diff --git a/dvc/command/remote.py b/dvc/command/remote.py
--- a/dvc/command/remote.py
+++ b/dvc/command/remote.py
@@ -13,12 +13,12 @@
 class CmdRemoteConfig(CmdConfig):
     def __init__(self, args):
         super(CmdRemoteConfig, self).__init__(args)
-        self.config = RemoteConfig(self.config)
+        self.remote_config = RemoteConfig(self.config)
 
 
 class CmdRemoteAdd(CmdRemoteConfig):
     def run(self):
-        self.config.add(
+        self.remote_config.add(
             self.args.name,
             self.args.url,
             force=self.args.force,
@@ -30,13 +30,13 @@ def run(self):
 
 class CmdRemoteRemove(CmdRemoteConfig):
     def run(self):
-        self.config.remove(self.args.name, level=self.args.level)
+        self.remote_config.remove(self.args.name, level=self.args.level)
         return 0
 
 
 class CmdRemoteModify(CmdRemoteConfig):
     def run(self):
-        self.config.modify(
+        self.remote_config.modify(
             self.args.name,
             self.args.option,
             self.args.value,
@@ -47,7 +47,7 @@ def run(self):
 
 class CmdRemoteDefault(CmdRemoteConfig):
     def run(self):
-        self.config.set_default(
+        self.remote_config.set_default(
             self.args.name, unset=self.args.unset, level=self.args.level
         )
         return 0
@@ -55,7 +55,9 @@ def run(self):
 
 class CmdRemoteList(CmdRemoteConfig):
     def run(self):
-        for name, url in self.config.list(level=self.args.level).items():
+        for name, url in self.remote_config.list(
+            level=self.args.level
+        ).items():
             logger.info("{}\t{}".format(name, url))
         return 0
 


Test patch: