fix analytics to use actual subcommand

This commit is contained in:
Michael Gummelt
2015-06-04 16:59:45 -07:00
parent 6dbf716f93
commit 99fc088b2d
3 changed files with 24 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import sys
import uuid
import dcoscli
import docopt
import requests
import rollbar
from concurrent.futures import ThreadPoolExecutor
@@ -216,6 +217,22 @@ def _rollbar_track_err(conf, err, exit_code):
logger.exception(e)
def _command():
""" Return the subcommand used in this dcos process.
:returns: subcommand used in this dcos process
:rtype: str
"""
# avoid circular import
import dcoscli.main
args = docopt.docopt(dcoscli.main.__doc__,
help=False,
options_first=True)
return args['<command>']
def _base_properties(conf=None):
"""
These properties are sent with every analytics event.
@@ -229,7 +246,7 @@ def _base_properties(conf=None):
conf = util.get_config()
if len(sys.argv) > 1:
cmd = 'dcos ' + sys.argv[1]
cmd = 'dcos ' + _command()
full_cmd = 'dcos ' + ' '.join(sys.argv[1:])
else:
cmd = 'dcos'

View File

@@ -1,7 +1,7 @@
[package]
cache = "tmp/cache"
sources = [ "https://github.com/mesosphere/universe/archive/version-1.x.zip",]
[core]
reporting = false
dcos_url = "http://172.17.8.101"
email = "test@mail.com"
reporting = false
[package]
sources = [ "https://github.com/mesosphere/universe/archive/version-1.x.zip",]
cache = "tmp/cache"

View File

@@ -1,6 +1,6 @@
[core]
email = "test@mail.com"
reporting = false
email = "test@mail.com"
[package]
sources = [ "git://github.com/mesosphere/universe.git", "https://github.com/mesosphere/universe/archive/master.zip",]
cache = "true"
sources = [ "git://github.com/mesosphere/universe.git", "https://github.com/mesosphere/universe/archive/master.zip",]