|
0 |
Description: Remove unwanted checks
|
|
1 |
We don't want that user updates with update option: no need to check the
|
|
2 |
version and to propose updates. We don't need to check if dependencies are
|
|
3 |
installed: apt does that at the installation.
|
|
4 |
Author: Sophie Brun <[email protected]>
|
|
5 |
Last-Update: 2016-08-18
|
|
6 |
---
|
|
7 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
0 | 8 |
--- a/faraday.py
|
1 | 9 |
+++ b/faraday.py
|
2 | |
@@ -131,10 +131,6 @@ def getParserArgs():
|
|
10 |
@@ -126,10 +126,6 @@ def getParserArgs():
|
3 | 11 |
default=False,
|
4 | 12 |
help="Ignore python dependencies resolution.")
|
5 | 13 |
|
|
10 | 18 |
parser.add_argument('--cert', action="store", dest="cert_path",
|
11 | 19 |
default=None,
|
12 | 20 |
help="Path to the valid CouchDB certificate")
|
13 | |
@@ -204,44 +200,6 @@ def query_user_bool(question, default=Tr
|
|
21 |
@@ -199,44 +195,6 @@ def query_user_bool(question, default=Tr
|
14 | 22 |
"(or 'y' or 'n').\n")
|
15 | 23 |
|
16 | 24 |
|
|
55 | 63 |
def startProfiler(app, output, depth):
|
56 | 64 |
"""Profiler handler.
|
57 | 65 |
|
58 | |
@@ -522,40 +480,6 @@ _/ ____\_____ ____________ __| _/__
|
|
66 |
@@ -458,40 +416,6 @@ _/ ____\_____ ____________ __| _/__
|
59 | 67 |
logger.info("Starting Faraday IDE.")
|
60 | 68 |
|
61 | 69 |
|
|
90 | 98 |
- if not resp == u'OK':
|
91 | 99 |
- logger.info("You have available updates. Run ./faraday.py --update to catchup!")
|
92 | 100 |
- else:
|
93 | |
- logger.info("No updates available, enjoy Faraday")
|
|
101 |
- logger.info("No updates available, enjoy Faraday.")
|
94 | 102 |
-
|
95 | 103 |
-
|
96 | 104 |
def checkCouchUrl():
|
97 | 105 |
import requests
|
98 | 106 |
try:
|
99 | |
@@ -571,30 +495,6 @@ def checkCouchUrl():
|
|
107 |
@@ -507,24 +431,6 @@ def checkCouchUrl():
|
100 | 108 |
# Non fatal error
|
101 | 109 |
pass
|
102 | 110 |
|
|
113 | 121 |
- getInstanceConfiguration().setVersion(f_version)
|
114 | 122 |
- f.close()
|
115 | 123 |
-
|
116 | |
- doc = {"ver": getInstanceConfiguration().getVersion()}
|
117 | |
-
|
118 | |
- if os.path.isfile(FARADAY_CONFIG):
|
119 | |
- os.remove(FARADAY_CONFIG)
|
120 | |
- with open(FARADAY_CONFIG, "w") as doc_file:
|
121 | |
- json.dump(doc, doc_file)
|
122 | 124 |
- except Exception as e:
|
123 | 125 |
- getLogger("launcher").error("It seems that something's wrong with your version\nPlease contact customer support")
|
124 | 126 |
- sys.exit(-1)
|
|
127 | 129 |
def init():
|
128 | 130 |
"""Initializes what is needed before starting.
|
129 | 131 |
|
130 | |
@@ -621,20 +521,12 @@ def main():
|
|
132 |
@@ -551,20 +457,12 @@ def main():
|
131 | 133 |
os.chdir(FARADAY_BASE)
|
132 | 134 |
|
133 | 135 |
init()
|
|
154 | 156 |
|
155 | 157 |
|
156 | 158 |
if __name__ == '__main__':
|
|
159 |
--- a/faraday-server.py
|
|
160 |
+++ b/faraday-server.py
|
|
161 |
@@ -54,36 +54,8 @@ def setup_environment(cli_arguments):
|
|
162 |
if cli_arguments.debug:
|
|
163 |
set_logging_level(server.config.DEBUG)
|
|
164 |
|
|
165 |
- missing_packages = check_dependencies()
|
|
166 |
-
|
|
167 |
- if len(missing_packages) > 0:
|
|
168 |
- answer = ask_to_install(missing_packages)
|
|
169 |
- if answer:
|
|
170 |
- logger.info(
|
|
171 |
- "Dependencies installed. Please launch Faraday Server again")
|
|
172 |
- sys.exit(0)
|
|
173 |
- else:
|
|
174 |
- logger.error("Dependencies not met")
|
|
175 |
- sys.exit(1)
|
|
176 |
-
|
|
177 |
server.config.gen_web_config()
|
|
178 |
|
|
179 |
-def check_dependencies():
|
|
180 |
- checker = DependencyChecker(server.config.REQUIREMENTS_FILE)
|
|
181 |
- missing = checker.check_dependencies()
|
|
182 |
- return missing
|
|
183 |
-
|
|
184 |
-def ask_to_install(missing_packages):
|
|
185 |
- logger = get_logger(__name__)
|
|
186 |
- logger.warning("The following packages are not installed:")
|
|
187 |
- for package in missing_packages:
|
|
188 |
- logger.warning("%s" % package)
|
|
189 |
- res = query_yes_no("Do you want to install them?", default="no")
|
|
190 |
- if res:
|
|
191 |
- checker = DependencyChecker(server.config.REQUIREMENTS_FILE)
|
|
192 |
- checker.install_packages(missing_packages)
|
|
193 |
- return res
|
|
194 |
-
|
|
195 |
def setup_and_run_server(cli_arguments):
|
|
196 |
import server.web
|
|
197 |
import server.database
|