Skip to content

Commit

Permalink
fix: Correct some misspelled words
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed Jan 6, 2025
1 parent d9fab0e commit 5efcb18
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 94 deletions.
18 changes: 1 addition & 17 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"overriden",
"varkw",
"TOOD",
"occured",
"Occurred",
"exitst",
"cnsistency",
"Releas",
Expand Down Expand Up @@ -389,8 +389,6 @@
"unarchived",
"creds",
"vmis",
"identiy",
"availibility",
"xcall",
"libsm",
"vite",
Expand All @@ -407,7 +405,6 @@
"saurabh",
"NEFT",
"clamav",
"offisite",
"primarys",
"LOUAA",
"gxzc",
Expand All @@ -416,9 +413,7 @@
"Nxzjr",
"Zvkq",
"sdext",
"Databse",
"sdomain",
"Minumum",
"ftrace",
"hrtimers",
"Regs",
Expand All @@ -435,9 +430,7 @@
"Unsuspending",
"nineth",
"unsuspended",
"achivements",
"ocsp",
"Proceeses",
"csvg",
"cpath",
"OWUVXXW",
Expand All @@ -456,16 +449,10 @@
"execv",
"chdir",
"tanmoy",
"specfied",
"momentjs",
"Reqeust",
"grequests",
"gget",
"ghead",
"Susbcriptions",
"Privary",
"Retreival",
"recieved",
"hdel",
"Syrus",
"Akbary",
Expand All @@ -480,13 +467,10 @@
"rtype",
"getitimer",
"ITIMER",
"Infrastruture",
"nedded",
"gstinhide",
"gstinshow",
"Initating",
"erpnextsmb",
"Occured",
"DSEes",
"OLQY",
"Uenf",
Expand Down
6 changes: 2 additions & 4 deletions press/api/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def installations(token):
}
)
else:
frappe.throw(data.get("message") or "An error occured")
frappe.throw(data.get("message") or "An error Occurred")

return installations

Expand Down Expand Up @@ -174,9 +174,7 @@ def repository(owner, name, installation=None):
headers = {
"Authorization": f"token {token}",
}
repo = requests.get(
f"https://api.github.com/repos/{owner}/{name}", headers=headers
).json()
repo = requests.get(f"https://api.github.com/repos/{owner}/{name}", headers=headers).json()

current_page, is_last_page = 1, False
branches = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def validate_duplicate(self):
},
):
frappe.throw(
"AWS Savings Plan Recommendation witht this timestamp already exists",
"AWS Savings Plan Recommendation without this timestamp already exists",
frappe.DuplicateEntryError,
)

Expand Down
6 changes: 3 additions & 3 deletions press/press/doctype/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@ def get_oci_config(self):
return config

def set_oci_availability_zone(self):
identiy_client = IdentityClient(self.get_oci_config())
availibility_domain = identiy_client.list_availability_domains(self.oci_tenancy).data[0].name
self.availability_zone = availibility_domain
identity_client = IdentityClient(self.get_oci_config())
availability_domain = identity_client.list_availability_domains(self.oci_tenancy).data[0].name
self.availability_zone = availability_domain

def provision_on_oci(self):
vcn_client = VirtualNetworkClient(self.get_oci_config())
Expand Down
2 changes: 1 addition & 1 deletion press/press/doctype/press_settings/press_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def get_github_app_manifest(self):

@property
def boto3_offsite_backup_session(self) -> Session:
"""Get new preconfigured boto3 session for offisite backup provider."""
"""Get new preconfigured boto3 session for offsite backup provider."""
return Session(
aws_access_key_id=self.offsite_backups_access_key_id,
aws_secret_access_key=self.get_password(
Expand Down
64 changes: 21 additions & 43 deletions press/press/doctype/self_hosted_server/self_hosted_server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2023, Frappe and contributors
# For license information, please see license.txt

from __future__ import annotations

import json

Expand Down Expand Up @@ -270,7 +271,7 @@ def create_new_rg(self):
try:
for app in task_result:
branches.append(app["branch"])
if not frappe.db.exists("App Source", {"app": app["app"], "branch": app["branch"]}):
if not frappe.db.exists("App Source", {"app": app["app"], "branch": app["branch"]}): # noqa: SIM102
if not frappe.db.exists("App", {"_newname": app["app"]}):
app_doc = frappe.get_doc(
{
Expand Down Expand Up @@ -324,10 +325,9 @@ def set_database_plan(self):
if self.database_plan:
return

if not self.different_database_server:
if not frappe.db.exists("Server Plan", "Unlimited"):
self._create_server_plan("Unlimited")
self.database_plan = "Unlimited"
if not self.different_database_server and not frappe.db.exists("Server Plan", "Unlimited"):
self._create_server_plan("Unlimited")
self.database_plan = "Unlimited"

def _create_server_plan(self, plan_name):
plan = frappe.new_doc("Server Plan")
Expand Down Expand Up @@ -359,7 +359,7 @@ def create_database_server(self):
"mariadb_root_password": self.get_password("mariadb_root_password"),
"cluster": self.cluster,
"agent_password": self.get_password("agent_password"),
"is_server_setup": False if self.new_server else True,
"is_server_setup": not self.new_server,
"plan": self.database_plan,
},
).insert()
Expand All @@ -375,7 +375,7 @@ def create_database_server(self):

frappe.db.commit()

frappe.msgprint(f"Databse server record {db_server.name} created")
frappe.msgprint(f"Database server record {db_server.name} created")
except Exception:
frappe.throw("Adding Server to Database Server Doctype failed")
self.status = "Broken"
Expand All @@ -393,10 +393,7 @@ def append_site_configs(self, play_name):
"output",
)
task_result = json.loads(
ansible_task_op.replace("'", '"')
.replace('"{', "{")
.replace('}"', "}")
.replace("\\n", "")
ansible_task_op.replace("'", '"').replace('"{', "{").replace('}"', "}").replace("\\n", "")
)
self.status = "Pending"
for site in task_result:
Expand Down Expand Up @@ -502,9 +499,7 @@ def create_new_sites(self):

@frappe.whitelist()
def restore_files(self):
frappe.enqueue_doc(
self.doctype, self.name, "_restore_files", queue="long", timeout=2400
)
frappe.enqueue_doc(self.doctype, self.name, "_restore_files", queue="long", timeout=2400)

def _restore_files(self):
"""
Expand Down Expand Up @@ -617,9 +612,7 @@ def setup_nginx(self, server):
port=server.ssh_port or "22",
variables={
"domain": self.name,
"press_domain": frappe.db.get_single_value(
"Press Settings", "domain"
), # for ssl renewal
"press_domain": frappe.db.get_single_value("Press Settings", "domain"), # for ssl renewal
},
)
play = ansible.run()
Expand All @@ -636,13 +629,9 @@ def update_tls(self):
)

try:
cert = frappe.get_last_doc(
"TLS Certificate", {"domain": self.server, "status": "Active"}
)
cert = frappe.get_last_doc("TLS Certificate", {"domain": self.server, "status": "Active"})
except frappe.DoesNotExistError:
cert = frappe.get_last_doc(
"TLS Certificate", {"domain": self.name, "status": "Active"}
)
cert = frappe.get_last_doc("TLS Certificate", {"domain": self.name, "status": "Active"})

update_server_tls_certifcate(self, cert)

Expand Down Expand Up @@ -679,20 +668,14 @@ def can_charge_for_subscription(self, subscription=None):

def _get_play_id(self):
try:
play_id = frappe.get_last_doc(
"Ansible Play", {"server": self.server, "play": "Ping Server"}
).name
play_id = frappe.get_last_doc("Ansible Play", {"server": self.server, "play": "Ping Server"}).name
except frappe.DoesNotExistError:
play_id = frappe.get_last_doc(
"Ansible Play", {"server": self.name, "play": "Ping Server"}
).name
play_id = frappe.get_last_doc("Ansible Play", {"server": self.name, "play": "Ping Server"}).name

return play_id

def _get_play(self, play_id):
play = frappe.get_doc(
"Ansible Task", {"status": "Success", "play": play_id, "task": "Gather Facts"}
)
play = frappe.get_doc("Ansible Task", {"status": "Success", "play": play_id, "task": "Gather Facts"})

return json.loads(play.result)

Expand Down Expand Up @@ -736,9 +719,7 @@ def validate_private_ip(self, play_id=None, server_type="app"):
public_ip = self.mariadb_ip

if private_ip not in all_ipv4_addresses:
frappe.throw(
f"Private IP {private_ip} is not associated with server having IP {public_ip} "
)
frappe.throw(f"Private IP {private_ip} is not associated with server having IP {public_ip} ")

@frappe.whitelist()
def fetch_private_ip(self, play_id=None, server_type="app"):
Expand Down Expand Up @@ -808,12 +789,10 @@ def check_minimum_specs(self):
"""

if round(int(self.ram), -3) < 4000: # Round to nearest thousand
frappe.throw(
f"Minimum RAM requirement not met, Minumum is 4GB and available is {self.ram} MB"
)
frappe.throw(f"Minimum RAM requirement not met, Minimum is 4GB and available is {self.ram} MB")
if int(self.vcpus) < 2:
frappe.throw(
f"Minimum vCPU requirement not met, Minumum is 2 Cores and available is {self.vcpus}"
f"Minimum vCPU requirement not met, Minimum is 2 Cores and available is {self.vcpus}"
)

self._validate_disk()
Expand All @@ -827,12 +806,11 @@ def _validate_disk(self):
if disk_storage_unit.upper() == "TB":
return True

if (
disk_storage_unit.upper() in ["GB", "MB"] and round(int(float(disk_size)), -1) < 40
):
if disk_storage_unit.upper() in ["GB", "MB"] and round(int(float(disk_size)), -1) < 40:
frappe.throw(
f"Minimum Storage requirement not met, Minumum is 50GB and available is {self.total_storage}"
f"Minimum Storage requirement not met, Minimum is 50GB and available is {self.total_storage}"
)
return None


def fetch_private_ip_based_on_vendor(play_result: dict):
Expand Down
2 changes: 1 addition & 1 deletion press/press/doctype/team/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def get_partnership_start_date(self):
def create_new_invoice(self):
"""
After enabling partner privileges, new invoice should be created
to track the partner achivements
to track the partner achievements
"""
# check if any active user with an invoice
if not frappe.get_all("Invoice", {"team": self.name, "docstatus": ("<", 2)}, pluck="name"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ frappe.query_reports['MariaDB Process List'] = {
{
fieldtype: 'Int',
default: 120,
label: __('Kill Proceeses Running Longer Than (Seconds)'),
label: __('Kill Processes Running Longer Than (Seconds)'),
fieldname: 'kill_threshold',
},
],
Expand Down
2 changes: 1 addition & 1 deletion press/saas/api/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_plans():
filtered_plans.append(plan)

"""
plans `site_api.get_site_plans()` doesn't include trial plan, as we don't have any roles specfied for trial plan
plans `site_api.get_site_plans()` doesn't include trial plan, as we don't have any roles specified for trial plan
because from backend only we set the trial plan, end-user can't subscribe to trial plan directly
If the site is on a trial plan, add it to the starting of the list
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_setup_wizard_payload(self):
return frappe._dict(_locals.get("payload", {}))

except Exception as e:
frappe.log_error(title="Product Trial Reqeust Setup Wizard Payload Generation Error")
frappe.log_error(title="Product Trial Request Setup Wizard Payload Generation Error")
frappe.throw(f"Failed to generate payload for Setup Wizard: {e}")

def get_user_login_password_from_signup_details(self) -> str | None:
Expand Down
4 changes: 2 additions & 2 deletions press/templates/saas/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h2 class="font-size-base mt-0">Verification Email Sent!</h2>
</div>
<h2 class="font-size-base mb-2">Payment Request Received</h2>
</div>
<span>Thank you for your payment request. We will send you a confirmation email shortly. In the meantime if you have any queries please reach us at
<span>Thank you for your payment request. We will send you a confirmation email shortly. In the meantime if you have any queries please reach us at
our <a href="https://frappecloud.com/support" class="text-blue-500 hover:text-blue-500">support page</a>.</span>
</div>
{% endmacro %}
Expand Down Expand Up @@ -163,6 +163,6 @@ <h2 class="font-size-base mb-2">Something Went Wrong</h2>

{% macro load_subs() %}
<div id="loading" class="mx-auto my-auto">
<span class="spinner-border spinner-border-sm mr-3" role="status"></span><span>Loading Susbcriptions </span>
<span class="spinner-border spinner-border-sm mr-3" role="status"></span><span>Loading Subscriptions </span>
</div>
{% endmacro %}
2 changes: 1 addition & 1 deletion press/templates/saas/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h2 class="font-size-base mt-0">Verification email sent</h2>
},
user_accept_terms: (value) => {
if (!value) {
return "You need to accept our Terms of Service & Privary Policy"
return "You need to accept our Terms of Service & Privacy Policy"
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions press/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def _validate_user_permissions(self):

def _handle_backups_retrieval_failure(self, response):
log_error(
"Backups Retreival Error - Magic Migration",
"Backups Retrieval Error - Magic Migration",
response=response.text,
remote_site=self.site,
)
Expand All @@ -377,7 +377,7 @@ def _handle_backups_retrieval_failure(self, response):
side = "Client" if 400 <= response.status_code < 500 else "Server"
error_msg = (
f"{side} Error occurred: {response.status_code} {response.raw.reason}"
f" recieved from {self.site}"
f" received from {self.site}"
)
frappe.throw(error_msg)

Expand Down
Loading

0 comments on commit 5efcb18

Please sign in to comment.